0% found this document useful (0 votes)
43 views

Fods QB

This document contains a question bank for the Foundations of Data Science course. It includes questions about data science concepts like the definition of data science, roles of data science in different domains, types of data, data science processes, and databases. It also provides explanations and examples for each question. The questions cover fundamental data science topics to help students learn the basics of the field.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Fods QB

This document contains a question bank for the Foundations of Data Science course. It includes questions about data science concepts like the definition of data science, roles of data science in different domains, types of data, data science processes, and databases. It also provides explanations and examples for each question. The questions cover fundamental data science topics to help students learn the basics of the field.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 35

A V S COLLEGE OF TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK
CS3352 FOUNDATIONS OF DATA SCIENCE
UNIT I
PART A

1. What is data science?

Data science is the study of data. It involves developing methods of recording, storing and analysing
data to effectively extract useful information. The goal of data science is to gain insights and
knowledge from any type of data – both structured and unstructured.

2. Explain the role of data science in business?

Data science is the requirement of every business to make business forecast and predictions based on
facts and figures, which are collected in the form of data and processed through data science. Data
science is also important for marketing promotions and campaigns.

3. Explain the role of data science in Medical Research?

Data science is necessary for research and analysis in health care, which makes it easier for
practitioners in both fields to understand the challenges and extract results through analysis and
insights proposed based on data.
The advanced technology of machine learning and artificial intelligence has been infused in the
field of medical science to conduct biomedical and genetic researches more easily.
4. Explain the role of data science in health care?

The clinical history of a patient and the medical treatment given is computerized and kept as a
digitalized record, which makes it easier for the practitioner and doctors to detect the complex
diseases at an early stage and understand its complexity.
5. Explain the role of data science in education?

Online personality tests and career counselling suggest students and individuals select a career
path based on their choices. This is done with the help of data science, which has designed
algorithms and predictive rationalities that conclude with the provided sets of choices.
6. Explain the role of data science in social media?

Most of the data of consumer behaviour, choices and preferences are being collected through
online platforms, which help the business grow. The systems are smart enough to predict and
analyse a user’s mood, behaviour and opinions towards a specific product, incident or event with
the help of texts, feedbacks, thoughts, views, reactions and suggestions.
7. Explain the role of data science in Technology?

The new technology emerging around us to ease life and alter our life and alter our lifestyle is all
due to data science. Some applications collect sensory data to track our movements and activities
and also provide knowledge and suggestions concerning our health, such as blood pressure and
heart rate. Data science is also being implemented to advance security and safety technology,
which is the most important issue now a days.
8. Explain the role of data science in financial institution?

Financial institutions use data science to predict stock markets, determine the risk of lending
money and learn how to attract new clients for their services.
9. Explain the main types/categories of data?
 Structured
 Unstructured
 Natural language
 Machine-generated
 Graph-based
 Audio, video and images
 Streaming

10. Explain natural language? Is natural language is instructed data

Yes, Natural language is a special type of unstructured data, it’s challenging to process because it
requires knowledge of specific data science techniques and linguistics. The natural language
processing is used it entity recognition, summarization, text completion and sentiment analysis.
Example: Predictive text, Search results.
11. What is Machine-generated data with example?

Machine-generated data is information that’s automatically created by a computer, process


application or other machine without human intervention. Machine-generated data is becoming a
major data resource and will continue to do so. The analysis of machine data relies on highly
scalable tools, due to its high volume and speed.
Examples of machine data are web server logs, call detail records, network event logs and
telemetry.

12. What is Graph-based or network data?

Graph or network data is, in short, data that focuses on the relationship or adjacency of objects.
The graph structures use nodes, edges and properties to represent and store graphical data. Graph-
based data is a natural way to represent social networks.
13. List the name of the steps involved in data science processing?
1. Setting the research goal
2. Retrieving data
3. Data preparation
4. Data exploration
5. Data modelling
6. Presentation and automation

14. What are OUTLIERS?

An outlier is an observation that seems to be distant from other observations or more specifically,
one observation that follows a different logic or generative process that the other observations.
15. What are the different ways of combining data?

The two operations that are performed in various data types to combine them are as follows:
i. Joining – enriching an observation from one table with information from another table.
ii. Appending or stacking – adding the observations of one table to those of another table.

16. What is big data?

Big data is a blanket term for any collection of data sets so large or complex that it becomes
difficult to process using traditional data management techniques. They are characterised by the
four Vs Velocity, variety, volume and veracity.
17. What is data cleansing?
Data cleansing is a sub process of the data science process that focuses on removing errors in your
data becomes a true and consistent representation of the processes.
18. Define the term setting the research goal (in data science processing)

The term setting the research goal mean Defining what, why and how of our projection in a
project charter.

19. Explain the term Retrieving data.

The term retrieving data means Finding and getting access to data needed in your project. This
data is either found within the company or retrieved from a third party.
20. What is data preparation and process?

It is the process of Checking and remediating data errors, enriching the data with data from other
data sources, and transforming it into a suitable format for your models.
21. Define data exploration process?

Data exploration process of Diving deeper into your data using descriptive statistics and visual
techiques.
22. What is data modelling?

It is the process of Building a model is an iterative process that involves selecting the variables for
the model, executing the model and model diagnostics. It is generally using machine learning and
statistical techniques to achieve our project goal.
23. Explain Presentation and automation process?

Finally present the results to the business. There results can take many forms, ranging from
presentations to research reports. Presenting the results to the stakeholdres and industrialising the
analysis process for repetitive reuse and integration with other tools.
24. What are the types of database?
 Column databases
 Document stores
 Streaming data
 Key-value stores
 SQL on Hadoop
 New SQL
 Graph databases.

25. What is a column database?

In this method Data is stored in columns, which allows algorithms to perform much faster queries.
Newer technologies use cell-wise storage. Table like structures are still important.
26. Explain document stores?

Document stores no longer uses tables, but store every observation in a document. This allows for
a much more flexible data scheme.

27. What is Streaming data?


Data is collected, transformed and aggregated not in batches but in real time. Although we’ve
categorised it here as a database to help you in tool selection, it’s more a particular type of problem
that drove creation of technologies such as Strom.

28. Define Key-value stores?


When Data isn’t stored in a table; rather you assign a key for every value, such as
org.marketing.sales 2015; 20000. This scales well but places almost all the implementation on the
developer.
29. Explain SQL on Hadoop?

Batch queries on Hadoop are in SQL-like language that uses the map-reduce framework in the
background.
30. What is New SQL?
This Class combines the scalability of NoSQL databases with advantages of relational databases. They
all have a SQL interface and a relational data model.

31. Explain Graph databases?

Not every problem is best stored in a table. Particular problems are more naturally translated into
graph theory and stored in graph databases. A classic example of this is a social network.
PART B
1. i) Explain the benefits of data science
ii) List the facets of data with example
2. Briefly explain the steps in data science process with diagram
3. Briefly explain the architecture of Data Mining
4. Briefly explain the architecture of Data warehouse
5. Explain briefly the need for Data Science with real time application
6. How do you set the research goal, retrieving data and Data preparation process in Data Science
process
7. How do you set the research goal, retrieving data and Data preparation process in Data Science
process
8. Explain the Data exploration, data modelling and presentation process in Data Science
9. Explain briefly above Normal curve.

UNIT II
PART A

1. What is Frequency distribution?

Frequency distribution is a collection of observations produced by sorting observations into


classes and showing their frequency (f) occurrence in each class.
2. What are they types and uses of Frequency distributions?

Types of Frequency distributions:


 Grouped frequency distribution.
 Ungrouped frequency distribution.
 Cumulative frequency distribution.
 Relative frequency distribution.
 Relative cumulative frequency distribution.

Uses:
A frequency distribution helps us to detect any pattern in the data (assuming a pattern exists) by
superimposing some order on the inevitable variability among observations.
3. What is Grouped frequency distribution?

When observations are sorted into classes of more than one value, the result is referred to as a
frequency distribution for grouped data.

4. What is ungrouped frequency distribution?

When observations are sorted into classes of single values the result is referred to as a frequency
distribution for ungrouped data.
5. What is cumulative frequency distribution?

Cumulative frequency distributions show the total number of observations in each class and in all
lower–ranked classes. This type of distribution can be used effectively with sets of scores, such as
test score for intellectual or academic aptitude, when relative standing within the distribution
assumes primary importance.
6. What is relative frequency distribution?

Relative frequency distributions show the frequency of each class a part or fraction of the total
frequency for the entire distribution.
7. Define Percentile Ranks?

The percentile rank of a score indicates the percentage of scores in the entire distribution with
similar or smaller values than that score.
8. What is Histograms?

A histogram is the most commonly used graph to show frequency distributions. It is a bar-type
graph for quantitative data. The common boundaries between adjacent bars emphasize the
continuity of the data, as with continuous variables.
9. Explain any three Features of histograms?

Equal units along the horizontal axis (the X axis, or abscissa) reflect the various class intervals of
the frequency distribution. Equal units along the vertical axis (the Y axis, or ordinate) reflect
increases in frequency. (The units along the vertical axis do not have to be the same width as those
along the horizontal axis.) . The body of the histogram consists of a series of bars whose heights
reflect the frequencies for the various classes.
10. What is Frequency Polygon?

Frequency Polygon is a line graph for quantitative data that also emphasizes the continuity of
continuous variables. Frequency polygons may be constructed directly from frequency
distributions.
11. What is mean?

The mean is found by adding all scores and then dividing by the number of scores.
MEAN = SUM OF ALL SCORES / NUMBER OF SCORES
12. What is median?

The median reflects the middle value when observations are ordered from least to most. The
median splits a set of ordered observations into two equal parts, the upper and lower halves. In
other works, the median has a percentile rank of 50, since observations with equal or smaller
values constitute 50 percent to the entire distribution.
13. What is mode?

Mode reflects the value of the most frequently occurring score. It is easy to assign a value to the
mode if the data are organised.
14. What if a distribution have More than one mode or no mode at all?
Distributions can have more than one mode (or no mode at all). Distributions with two obvious
peaks, even though they are not exactly the same height, are referred to as bimodal. Distributions
with more than two peaks are referred to as multimodal. The presence of more than one mode
might reflect important differences amount subsets of data.

15. Explain Range, variance and standard deviation?

Range: The range is difference between the largest and smallest scores.
Variance: The variance is a measure of variability.
Standard deviation: Standard deviation is a measure of the amount of variations or dispersion of a
set of value. A low standard deviation indicates that the values tend to be close to the mean of the
set, while high standard deviation indicates that the values are spread out over a wider range.
Standard deviation = √ variance
16. What is DEGREES OF FREEDOM (df)?

Degrees of freedom (df) refers to the number of values that are free to vary, given one or more
mathematical restrictions, in a sample being used to estimate a population characteristic.
17. What is INTERQUARTILE RANGE (IQR)?

Interquartile range (IQR), is simply the range for the middle 50 percent of the scores. More
specifically, the IQR equals the distance between the third quartile (or 75th percentile) and the first
quartile.
18. Define Normal curve and its properties.

The normal curve is a theoretical curve defined for a continuous variable, and noted for its
symmetrical bell-shaped form.
Properties of Normal curve:
The normal curve is symmetrical; its lower half is the mirror image of its upper half. Being bell
shaped, the normal curve peaks above a point midway along the horizontal spread and then tapers
off gradually in either direction from the peak (without actually touching the horizontal axis, since
in theory the details of a normal curve extend infinitely far).
19. What is Z-score?

A z score is a unit-free, standardized score that, regardless of the original units of measurement,
indicates how many standard deviations a score is above or below the mean of its distribution.
Where X is original score μand σ are the mean and the standard deviation, respectively.

PART B
1. Explain the different types of frequency distribution with example.
2. 8 The IQ scores for a group of 35 high school dropouts are as Describe Mean,
a follows: Median, Mode
and 91 85 85 79 80 Averages with
87 96 75 86 104 example.
95 71 105 90 77
12
3 80 100 93 108
98 69 99 95 90
11
0 109 94 100 103
11
2 90 90 98 89
(a) Construct a frequency distribution for grouped data
3. Specify the real limits for the lowest class interval in this frequency distribution
4. Analyse how graph can be used to represent qualitative and quantitative data?
5. Generate the ungrouped and grouped frequency table for the following data
90,92,87,88,87,92,98,90,90,87,87,88,88,89,90,87,89,92,92,92,98,90,95,87,87

(i) How many people scored 98?


(ii) How many people scored 90 or less?
(iii) What proportion scored 87?
6. (i) Calculate the sum of square population standard deviation for the given x data value

13,10,11,7,9,11,9
(ii) Calculate the sample standard deviation for the given data 7,3,1,0,4.
7. Suppose the IQ score have a bell shaped distribution with a mean of 100 and standard
deviation of 15 then calculate the following.
(i) What percentage age of people should have an IQ score between 85 and 115?
(ii) What percentage of people should have an IQ score between 70 and 130?
(iii) What percentage of people should have an IQ score more than 130
(iv) A person with an IQ score greater than 145 is considered as genius. Does the empirical
rule support this statement?

UNIT III
PART A
1. What is correlation?

The correlation is a statistical measure that expresses the extent to which two variables are linearly
related. It’s a common tool for describing simple relationships without making a statement about
cause and effect.
The same correlation coefficient, r, quantifies the strength of the relationship. Correlations are also
tested for statistical significance.
2. Define Scatterplots?

A scatterplots is a graph containing a cluster of dots that represents all pairs of scores. With a little
training, you can use any dot cluster a preview of a fully measured relationship.
3. What is correlation coefficient?

A correlation coefficient is a number between -1 and 1 that describes the relationship between
pairs of variables. The type of correlation coefficient, designated as r that describes the linear
relationship between pairs of variables form quantitative data.
4. Define Regression.

A predictive modelling technique that evaluates the relation between dependent (i.e. the target
variable) and independent variables is known as regression analysis. Regression analysis can be
used for forecasting, time series modelling, or finding the relation between the variables and
predict continuous values.
5. Write the types of Regression analysis.

Types of Regression Analysis:


1. Simple Linear Regression
2. Multiple Linear Regression
3. Polynomial Regression
4. Logistic Regression
5. Ridge Regression
6. Lasso Regression
7. Bayesian Linear Regression
8. Decision Tree Regression
9. Random Forest Regression

6. Differentiate single and multiple linear regression?

Simple Linear Regression:


Linear regression is the most basic form of regression algorithms in machine learning. The model
consists of a single parameter and a dependent variable has a linear relationship. We denote simple
linear regression by the following equation given below
Y = mx + c + e
Where m is slope of the line, c is an intercept and e represents the error in the model
Multiple Linear Regression:
When the number of independent variables increases, it is called the multiple linear regression
models.
Y = b0 + b1x1
7. What is ridge regression?

Ridge Regression is another type of regression in machine learning and is usually used when there
is a high correlation between the parameters. This is because as the correlation increases the least
square estimates give unbiased values.
8. What is decision tree?

The decision tree as the name suggests works on the principle of conditions. It is efficient and has
strong algorithms used for predictive analysis. It has mainly attributed that include internal nodes,
branches and a terminal node. Every internal node holds a “test” on an attribute, branches hold the
conclusion of the test and every leaf node means the class label. It is used for both classifications
as well as regression which are both supervised learning algorithms.
PART B
1. How correlation coefficient can be calculated for the quantitative data?
2. Explain the different types of regress analysis in detail.
3. Briefly explain in detail standard error of estimate.
4. Calculate the value of r using computation formula for the following data.

FRIENDS SENT RECEIVED


Dories 13 14
Steve 9 18
Mike 7 12
Andrea 5 10
John 1 6
5. Explain about regression towards mean in detail.
UNIT IV
PART A
1. What is NumPy in Python used for?

Numpy is a Python library used for working with arrays.

2. Write a python program create an array?

Import numpy as np
np.array([1,4,2,5,3])
OUTPUT: array([1,4,2,5,3])
3. Write the output of the following numpy code:
i. np.array([3,14,4,2,3])
ii. np.array([1,2,3,4], dtype=’float32’)
iii. np.array([range(I,i+3) for I in [2,4,6]])
iv. np.zeros(10,dtype=int)
v. np.ones(3,5), dtype-float)
vi. np.full((3,5),3.14)
vii. np.arrange(0,20,2)
viii. np.linspace(0,1,5)
ix. np.random.random((3,3))
x. np.random.normalA(0,1,(3,3))

OUTPUT
i. array([3.14, 4. , 2 , 3.])
ii. array([1.,2.,3.,4], dtype=float32
iii. array([2,3,4])

[4, 5, 6]
[6, 7, 8]])
iv. array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ])
v. array([1.,1.,1.,1.,1.].
[1.,1.,1.,1.,1.].
[1.,1.,1.,1.,1.]])
vi. array([[3.14, 3.14, 3.14, 3.14, 3.14],
[3.14, 3.14, 3.14, 3.14, 3.14],
[3.14, 3.14, 3.14, 3.14, 3.14]])
vii. array([0, 2, 4, 6, 8, 10, 12, 14, 16, 18])
viii. array([0. ,0.25, 0.5, 0.75, 1.])
ix. array([[0.15175932, 0.58606546, 0.68749167],
[07.75655189, 0.23198831, 0.94250833],
[0.95147981, 0.50405388, 0.22004745]])

4. Define Series Object.

A Panda Series is a one-dimensional array of indexed data. It can be created from a list or array.
Example:
Data = pd.Series([0.25, 0.5, 0.75, 1.0])
print(data)
The output will be displayed as
0 0.25
1 0.50
2 0.75
3 1.00

dtype: float64
What is Data frame?
A DataFrame is an analog of a two-dimensional array with both flexible row indices and flexible
column names. DataFrame as a sequence of aligned Series objects.
Example:
States=pd.DataFrame({‘population’:population,’area:area})
print(states)
Output:
area population
California 423967 38332521
Florida 170312 19552860
Illinois 149995 12882135
New York 141297 19651127
Texas 695662 26448193

5. How a pandas dataframe cane be constructed?

i) From a single Series object


ii) From a list of dicts
iii) From a dictionary of Series objects
iv) From a two-dimensional Numpy array
v) From a Numpy structured array

6. What is indexers?

Pandas provides some special indexer attributes that explicitly expose indexing schemes. They are loc,
iloc and ix.

loc attribute – allows indexing and slicing that always references the explicit index.
Iloc attribute – allows indexing and slicing that always references the implicit Python-style index
Ix – is a hybrid of the two and for Series objects is equivalent to standard []-based indexing.

7. How missing data can be handled in phython?

None. a Python singleton object that is often used for missing data in Python code.
Example:
Import numpy as np
Import pandas as pd
val=np array([1, None, 3, 4])
(val)
Output: array([1, None, 3, 4], dtype=object)
The other missing data representation, NAN (Not A Number), is a special floating-point value
recognized by all systems that use the standard IEEE floating-point representation:
Example
val=np.array([1 ,np,nan,3, 4])
print( val.dtype)
Output: dtype(‘float64’)
8. How the operations can be performed on null values in pandas data structure?

There are several useful methods for detecting, removing and replacing null values in Pandas data
structures.
They are:
Isnull() – Generate a Boolean mask indicating missing values
Notnull() – Opposite is isnull()
Dropna() – Return a filtered version of the data
Fillna() – Return a copy of the data with missing values filled or imputed.
9. Define Hierarchical Indexing.

Hierarchical indexing also known as multi-indexing is used to incorporate multiple index levels
within a single index. In this way, higher-dimensional data can be compactly represented within
the familiar one-dimensional Series and two-dimensional DataFrame Objects.
10. What is pivot table?
The pivot table takes simple column-wise data as input, and groups the entries into a two-dimensional
table that provides a multidimentional summarization of the data.

PART B
1. Briefly explain the basics of numpy arrays with example
2. Describe about fancy indexing with example
3. Explain structured data in numpy array
4. What is universal function? Explain clear each function with example.
5. Explain aggregate functions with example?
6. What is broadcasting and explain the rules with examples?
7. Expalin data objects in pandas.
8. Briefly explain the hierarchical indexing with examples.
9. What is pivot table? Explain it clearly.

UNIT V
PART A

1. What is the purpose of matplotlib?

Matplotlib is a cross-platform, data visualization and graphical plotting library for Python and its
numerical extension NumPy. One of Matplotlib’s most important features is its ability to nplay well
with many operating systems and graphics backends.

2. Write the dual interface of matplotlib?

The dual interfaces of matplotlib are: a convenient MATLAB – style state-based interface and more
powerful object-oriented interface.

3. How to draw a simple line plot using matplotlib?

Import matplotlib.pyplot as plt


plt.style.use(‘seaborn-whitegrid’)
import numpy as np
fig=plt.figure()
ax=plt.axes()
x=np.linspace(0,10,1000)
ax.plot(x,np,sin(x))

4. What functions can be used to draw the scatterplot?

Plt.plot are the functions used to draw the scatter plots.


Example:
X=np.linspace(0,10,30)
Y=np.sin(x)
Plt.plot(x,y,’O’,color=’black’);

Output:

A second, more powerful method of creating cater plots is the plt.scater function, which can be used
very similarly to the plt.plot function.
Example:
Plt.scatter(x,y, marker=’o’)

5. Write the difference between plot and scatter functions?

The primary difference of plt.scatter from plt.plot is that it can be used to create scatter plots
where the properties of each individual point (size, face color, edge color, etc) can be individually
controlled or mapped to data.
6. Define contour plot?

Contour plot used to plot three dimentional data into two dimentional data. A contour plot can be
created with the plt.contour function. It takes three arguments: a grid of x values, a grid of y
values, and a grid of z values.
7. What are the functions can beused to draw the contour plots?

Plt.contour.plt.contourf, and plt.imshow are the functions used to draw the contour plots.
Example:
x=np.linspace(0,5,50)
y=np.linspace(0,5,40)
X,Y = np.meshgrid(x,y)
Z=f(X,Y)
Plt.contour(X,Y,Z, color=’black’)
Output:

8. What is the purpose of using histogram?

A Simple histogram is very useful in understanding a dataset. It is used to specify the frequency
distributions between two variables.
Example:
Plt.style.use(‘scborn-white’)
Data=np.randon.randn(1000)
Plt.hist(data)

9. Write the source code to draw a simple histogram?

Import numpy as np
Import matplotlib.pyplot as plt
Plt.style.use(‘seaborn-white’)
Data=np.random.randn(1000)
Plt.hist(data)
Output:

10. How to create a three-dimensional wireframe plot?

The three-dimensional plots that work on gridded data are wireframes. It take a grid of values and
project it onto the specified three dimensional surface, and can make the resulting three-
dimensional forms quite easy to visualize.
Example:
fig=plt.figure()
ax=plt.axes(Projection=’3d’)
ax.plot_wireframe(X,Y,Z, color=’black’)
ax.set_title(‘wireframe’)
Output:
11. Define surface plot?

A surface plot is like a wireframe plot,but each face of the wireframe is filled polygon. Adding a
colormap to filled polygons can aid perception of the topology of the surface being visualizes.
Example:
ax=plt.axes(projection=’3d’)
ax.plot_surface(X,Y,Z,rstride=1,cstride=1,
cmap=’viridis’.edgecolor=’none’)
ax.set_title(‘surface’)
Output:

12. What is the use of seaborn?

Seaborn is a open-source Python library built on top of matplotlib. It is used for data visualization
and exploratory data analysis. Seaborn works easily with data frames and the Pandas library. The
graphs created can also be customized easily.
Below are a few benefits of Data Visualization:
Graphs can help us find data trends that are useful in any machine learning or forecasting project.
Graphs make it easier to explain your data to non-technical people.
Visually attractive graphs can make presentations and reports much more appealing to the reader.
PART B
1. What is matplotlib? Specify the two interfaces used by it.
2. Briefly explain about the line plot and scatter plot.
3. Explain contour plot and histogram.
4. What is 3D plotting? Explain it with example.
5. How graphical data can be projected using matplotlib? Explain with example.

SIGN OF SUBJECT INCHARGE SIGN OF HOD


Mrs.M.R.NITHYAA, AP/CSE
CS3353 C PROGRAMMING AND DATA STRUCTURES L T PC
3 0 03

COURSE OBJECTIVES:
 To introduce the basics of C programming language.
 To learn the concepts of advanced features of C.
 To understand the concepts of ADTs and linear data structures.
 To know the concepts of non-linear data structure and hashing.
 To familiarize the concepts of sorting and searching techniques.

UNIT -I C PROGRAMMING FUNDAMENTALS (8+1 SKILL) 9


Data Types – Variables – Operations – Expressions and Statements – Conditional Statements
– Functions – Recursive Functions – Arrays – Single and Multi-Dimensional Arrays.

UNIT II C PROGRAMMING - ADVANCED FEATURES (8+1 SKILL) 9


Structures – Union – Enumerated Data Types – Pointers: Pointers to Variables, Arrays and Functions –
File Handling – Preprocessor Directives.

UNIT III LINEAR DATA STRUCTURES (8+1 SKILL) 9


Abstract Data Types (ADTs) – List ADT – Array-Based Implementation – Linked List – Doubly-
Linked Lists – Circular Linked List – Stack ADT – Implementation of Stack – Applications – Queue
ADT – Priority Queues – Queue Implementation – Applications.

UNIT IV NON-LINEAR DATA STRUCTURES (8+1 SKILL) 9


Trees – Binary Trees – Tree Traversals – Expression Trees – Binary Search Tree – Hashing
- Hash Functions – Separate Chaining – Open Addressing – Linear Probing– Quadratic Probing –
Double Hashing – Rehashing.

UNIT V SORTING AND SEARCHING TECHNIQUES (8+1 SKILL) 9


Insertion Sort – Quick Sort – Heap Sort – Merge Sort –Linear Search – Binary Search.
TOTAL45 PERIODS
TWO MARK QUESTIONS WITH ANSWERS
UNIT -I C PROGRAMMING FUNDAMENTALS

1.What is primitive data type?


 Primitive data type in C are the fundamental data types such as –int,float,char and void.
 The int data type is for representing the whole number values.
2.What is the difference between for and while statement?

For While

 Initialization,termination and iteration  Only initialization and


are the three conditions that are termination conditions are
written with in a loop at the top of the written at the top of the loop
loop
For(initialization;condition;iteration) While(condition)
{ {
Body of the loop Statement;
} }
 In ‘for’ loop the initialization once  The while loop is used only
done is never repeated when we do not know exact
number of iterative.

3.What is the use of void data type?


 The void data type indicates that the function is returning nothing.
 If the function is not returning anything from the function then its data type is specified as void.
4.What is the use of arrays?
Array is used to store the elements of same data type.For storing the strings-the array is used.
5.How will you initialize array in C?
There are two ways by which an array can be initialized-
 Initializing an array at declaration.
 Initializing an array with the help of loop.
6.Define an array.Give an example.(nov,dec 2014)
 An array can be defined as a group of related data items that share a common name.
 An array can also be defined as an ordered sequence of finite data items is known as an “element”
of the array.
 Arrays in C language = are static type and hence the size of array cannot be altered at run time.
7.What do you meant by control statements?
Control statements are program statements that cause a jump of control from one part of program to
another part of program.
8.Define function.
Functions are group of statements that can perform a task.Functions reduce the amount of coding and one
function can be called from another function.
e.g
void fun()
9..Define macro with an example.
 Macros are piece of code in aprogram which is given some name.Whenever this name is
encountered by the compiler the compiler replaces the anme the actual piece of code.
 The ‘#define’directive is used ti define a macro.
e.g #define PI 3.14
10.Write the syntax of switch case statement.
Switch(condition)
{
Case caseno:
Statements break;
….
Default:statements
}
11.What is a static variable?Give an example.
Static variables are those variable that retain their values even after they come out of the scope.
e.g:#include<stdio.h>
int fun()
{
Static int count=0;
Count++;
return count;
}
12.How an n dimensional array is represented?
 A multidimensional array is declared using the following syntax:
 Type array_name[d1][d2][d3][d4]…..[dn]
 Where each d is a dimension and dn is the size of final dimension.
 Syntax: data_type array_name[table][row][column];
13. Write a C program to find factorial of a given number using Iteration.
void main()
{
int n=5,I,fact=1;
for(i=1;i<=N;i++)
fact=fact*i;
printf(―The factorial value of %d is =%d‖,N,fact);
}
14.State the ouput of the code and justify the answer.(Apr/May 2017)
#include<stdio.h>
Main()
{
Char const *st=’HELLO’;
*st=’M’;
Printf(%c\n”,st);
St=”bye”;
Printf(“%s\n”,st);
}
15.Describe Enumerated Data type.
 Enumerated data type is used to assign names to integral constants to make a program easy to
read and maintain.The keyword ‘enum’.
16. What are Operators? Mention their types in C.
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C
language is rich in built-in operators and provides following type of operators:
 Arithmetic Operators
 Relational Operators
 Logical Operators
 Bitwise Operators
 Assignment Operators
17. Write short notes about main ( ) function in ’C’ program. (MAY 2009)
 Every C program must have main ( ) function. All functions in C, has to end with ‘( )’ parenthesis
 It is a starting point of all ‘C’ programs.
 The program execution starts from the opening brace ‘{‘ and ends with closing brace ‘}’, within which
executable part of the program exists.
18.What are the types of looping statements available in C.
C programming language provides following types of loop to handle looping requirements.
while loop
 Repeats a statement or group of statements while a given condition is true. It tests the condition before
executing the loop body.
do...while loop
 Execute a sequence of statements multiple times and abbreviates the code that manages the loop
variable.
Like a while statement, except that it tests the condition at the end of the loop body You can use one or more loop
inside any another while, for or do..while loop.
19. What is the variable? Illustrate with an example –
 Variable is a named storage area - Used to assign a name to a value –
 To declare a variable, we need to specify the data type of the value and the variable name Data type
variable _name ; - Example int reg; float avg;
20. What is a function?
 Function is a set of instructions ,Self contained block Performs a specific task.
 Used to avoid redundancy of code
Part –B
1.List all the operator in C with an example for each.
2.Describe the various operators in C with examples and the associativity.
3.Explain control statements in C
4.Describe the decision making,branching and looping statements in C.
5.Explain with a suitable example,function call by reference and function call by value.
6.Write suitable ‘C’ program that creates different result after passing a parameter by reference and by
values.
7.Write a C program to find factorial of a number .Using recursive function.
8.Discuss in detail about the concept of array.with example.
9.Illustrate the usage of single dimensional Array and two dimensional array.
10.Illustrate pass by value and pass by reference in functions with an example.
UNIT-II
C PROGRAMMING - ADVANCED FEATURES
1..Will the following declaration work.Justify your answer.?May/June 2015
Struct student
{
Int rollno=12;
Float marks[]={55,60,56};
Char gender;
};
Answer:
No, It will not work as the memory allocation will not be done during definition, initialization of data
members is not possible.
2..List any four advantages of pointers.(Dec -2019)
 Pointers are used to allocate memory to structure variables during run time.
 Using pointer, it is efficient to pass arrays and strings to functions.
 It can be used to access a variable that is defined outside the function.
 It provides an alternate way to access array elements.
3.What are function pointers in C?
 A pointer to a function is known as Function Pinter in C.
 Syntax: return –type(*function-pointer)(function argument list);
 e.g : void(*ptrfn1)(int);

4.Compare Structure and Union.(Dec-2018)


Structure Union

 A struct allocates memory for each  All members of the ‘uion’ share the
member such that all members can be same memory location it is not possible
used at once. to access more than one member at a
time.
 All the members can be initialized.  Only the first member of an union can
be initialized.
 It provides single way to view each  Union provides multiple way to view
memory location. same memory location.
 Anonymous structure is not possible.  Anonymous union can be declared.

5.Differentaite between call by value and call by reference.


Call by value Call by reference

 When a function is called,then in that  When a function is called,then in that


function actual values of the parameters function addresses of the parameters
are passed. are passed
 The parameters are simple variables.  The parameters are pointer variables.

 Complier executes this type function  Complier executes this type of function
slowly as values get copied to formal faster as addresses get copied to the
parameters. formal parameters.

6..What is Union?

o Union is a user defined data structure which is just similar to structure.


o It is used to store members of different data types.
7.Define preprocessor directives and list out a few example.(Dec-2018,May-2019)
 Preprocessor directive is a kind of program which is used to preprocess the C program before
compiling.
 Commands used in preprocessor are called preprocessor directives and they begin with symbol #
 e.g, Macro :Using #define the constant value can be defined.
8.What does # include <header_name> do ?How is it possible to tell the preprocessor where to look
for header files?(Dec-2019)
The # include is a preprocessor directive which requests the header file. It is
possible to tell the preprocessor to look for the desired header file by specifying its name path of the file.
For standard header files of C program the system directories are searched.
9. Give applications in which unions rather than structures can be used.
 Unions can be used no more than one member needs to be accessed at a time.That way, we can
save some memory.
 e.g incase of person’s gender information ->a person can be either female or male.
10.Specify the important types of preprocessor Directives.
 Macro Expansions
 File inclusion –It is used include one file in another file.
 e.g #include <stdio.h>
 Conditional compilation
 Miscellaneous directives.
11.Define Enumerated Data Type.
 Enumerated data type is used to assign names to integral constants to make a program easy to read
and maintain.
 The keyword ‘enum’ is used.
 Syntax: enum identifier[optional{enumerator-list}];
 e.g : enum week_day{sun,Mon,Tue,Wed,Thurs,Fri,Sat};
12.Define macro with an example.(May/June 2014)
 Macros are piece of code in a program which is given some name.whenever this anme is
encountered by the complier replaces the name with the actual piece of code.
 # define directive is used to define a macro
 e.g #define PI 3.14.
13. Write the syntax for pointers to structure.
Struct S
{
char datatype1;
int datatype2;
float datatype3;
};
Struct S *sptr.
14. What you meant by structure definition?
 A structure type is usually defined near to the start of a file using a typedef statement.
 typedef defines and names a new type, allowing its use throughout the program.
 typedefs usually occur just after the #define and #include statements in a file.
 example structure definition.
typedef struct
{
char name[64];
char course[128];
int age;
int year;
} student;
15. How can you access the members of the Union?
 To access any member of a union, we use the member access operator (.).
 The member access operator is coded as a period between the union variable name and the union member
that we wish to access.
16. What are the storage classes available in C?
There are following storage classes which can be used in a C Program auto register static extern.
17. What is register storage in storage class?
 Register is used to define local variables that should be stored in a register instead of RAM.
 This means that the variable has a maximum size equal to the register size (usually one word) and cant have
the unary '&' operator applied to it (as it does not have a memory location).
{
register int Miles;

18. Define Auto storage class in C.


Auto is the default storage class for all local variables.
{
int Count;
auto int Month;
}. auto can only be used within functions, i.e. local variables.
19. What is meant by Union in C.?
 A union is a special data type available in C that enables you to store different data types in the
same memory location.
 We can define a union with many members, but only one member can contain a value at any given
time.
 Unions provide an efficient way of using the same memory location for multi-purpose.
20. What are * and & operators means?
 ‘*’ operator means ‘value at the address’
 ‘&’ operator means ‘address of
PART –B
1.Briefy explain about the structure and its initialization process with suitable example.(May-2017,Dec-
2018,2019)
2.Define a structure to store details of 10 bank customers with customer name,account no,balance and
city.Write a Cprogram to store the details of customers in the bank,access and print the customer details
for a specified account no.(May 2017)
3.Explain about union and it initialization process .with suitable example.(May -2019)
4.Explain the data type enumeration?What are the various operations that can perform on enumeration?
5.Explain about how to declare pointer to a function with an example.(May 2017)
6.Explain the functions for file handling operations.
7.Write a program to convert all upper case letters to lower case and vice versa in a given string.(Apr-
2017).
8.Explain the advantages and disadvantages of structures and unions(Apr/May 2015).
9.Illustrate the representation of structure and union for an employee record having
empid,emp_name,DOB,basic pay,allowances,deductions,grosspay and netpay.Examine their memory
allocation.
10.Write a C program to get 10 student details using structures from the user and display these details on
the screen.(Dec-2018).
UNIT -3
LINEAR DATA STRUCTURES
1.Define the term data structure.
 The data structure can be defined as the collection of elements and all the possible operations
which are requires=d for those set of elements.
 Formally data structure can be defined as a data structure is a set of domains D,a set of functions
F,and a set of axioms A.
2.What is abstract data type?(Dec-2019)
 Abstract Data Types is a data structure that provides a set of operations.
 ADT are mathematical model of the data objects that make up a data type as well as the functions
that operate on these objects.
3.Write short notes on queue.
 A queue is structured and an ordered collection of items which are added at one end,called the
“rear”and removed from the other end,called the “front”
 Queue mechanism is known as First In First Out(FIFO)
4.Define priority queue.
 A Priority queue is an abstract data type which is like a regular queue data structure but where
additionally each element has a “priority” associated with it.
 A priority queue an element with high priority is served before an element with low priority.
5.Compare LIFO and FIFO.
LIFO FIFO

 Stack is a heap of elements placed one  Queue is a set of elements placed one
over the other after the other.
 The object that is inserted first is  The object that is inserted first is
removed last. removed first.

 Only one pointer top is used.  Two pointers namely front and rear are
used.
 Stack is a linear data structure.  Queue is a linear data structure.

6.List out applications of stack.(Dec-2019)


 Balancing of symbols.
 Reversing a string.
 Parsing
 Evaluation of an expression
 Towers of Hanoi problem
7.List the advantages in the Linked list implementation of stack.
 Linked list is dynamic data structure.
 Insertion and Deletion operations are easier using a Linked list.
8.Convert the infix expression a+b*c+(d*e+f)*g into postfix.
Infix expression : a+b*c+(d*e+f)*g
Postfix expression:abc*+de*f+g*+
9.What is singly linked linked list?
 A linked list is a liner data structure an is made up of number of nodes.
 Nodes are structure made up of data and a pointer to another node.
 It allows for traversing the list in only one direction.
10.What is the advantage of an ADT?(Dec-2018)
 The implementation of the ADT can be changed without making changes in the main program
 Understandability.
 The ADT can be reused by some program in future.
 Different implementations are possible for the same ADT.
11. List the applications of linked list.(Dec-2017)
 Polynomial manipulation.
 Linked stack implementation.
 Linked queue implementation
 Implementation of graph.
12.What is a dequeue?
The dequeue is a data structure in which the element can be inserted from both the ends i.e front and
rear .Similarly the element can be deleted from both the front and rear end.
13.What is a Linked List?(Dec-2019)
A Linked list is a nodes where each node has two fields ‘data’ and ‘link’.
The data field is used to store actual piece of information and link field is used to store address of next
node.
14.Explain the various operations that can be performed on data structure.
 Create.
 Insertions of element.
 Deletion of element.
 Searching for the desired element.
 Sorting the elements in the data structure.
 Reversing the list of elements.
15.What are priority queues?
 The priority queues is a data structure having a collection of elements which are associated with
specific ordering.
 There are two ways to implement priority queue.
1. Ascending priority queue.
2. Decsending priority queue.
16.State the rules to be followed during infix to postfix conversion.(Dec-2016)
 If an operand is encountered then add it to postfix array.
 If ‘(‘ is read,then simply push it onto the stack.
 If ’)’ is read,then pop all the operands until { is read.
 Discard (.Store the popped characters in the postfix array.
17. What are the ways of implementing linked list?
The list can be implemented in the following ways:
i.Array implementation
ii. Linked-list implementation .
iii. Cursor implementation.
18. What are the types of linked lists?
There are three types
i. Singly linked list
ii. ii. Doubly linked list
iii. iii. Circularly linked list
19. What are the operations of a queue?
The operations of a queue are ● isEmpty() ● isFull() ● insert() ● delete() ● display()
20. Write a routine for IsEmpty condition of queue.
If a queue is empty, this function returns 'true', else it returns 'false'.
bool isEmpty(int front, int rear)
{
return (front == rear);
}
PART –B
1.Describe in detail about the concept of ADT in data structure.(May-2019)
2.Discuss in detail about he stack ADT with suitable example.(May-2015)
3.Write an algorithm to convert an infix to postfix expression trace the algorithm to convert the infix
expression (a+b)*c/d+e/f to a postfix expression. Explain the need for infix and postfix expressions.
4. Evaluate given postfix expression.(Dec-2016)
AB+C-BA+C$ for A=1,B=2 C=3.(Dec-2018)
5. Develop an algorithm to implement QUEUE ADT.Give relevant examples and diagrammatic
representations.
6. Implement a priority queue using linked list.
7.What are the ways to insert a node in Linked List?.Write an algorithm for inserting a node before a given
node in a linked list?
8.Illustrate the algorithm to implement the doubly linked list and perform all the operations on the created
list.
9.Write a procedure to deleting the last node from a circular linked list.(Dec-2018)
10.What are the applications of linked list in dynamic storage management?(Dec-2019).

UNIT -4
NON-LINEAR DATA STRUCTURES

1.Define Binary Tree.


A binary tree is a finite set of nodes which is either empty or consist of root and two
disjoint binary tress called the left sub tree and right sub tree.
2.What is level of a tree?
The root node is always considered at level zero.The adjacent nodes to root are
supposed to be at level 1 and so on.
3. What is a tree?
 A tree is a non-linear data structure in which items are arranged in a sorted sequence.
 It is used to represent hierarchical relationship with a root value and subtrees of children with a
parent node, represented as a set of linked nodes.
4.What is complete and Full binary tree?
A complete binary tree is a binary tree in which every level,except possibly the last,
is completely filled and all nodes are as far left as possible.
5.What is Heap?What are its types?
 A heap is an ordered balance binary tree in which the value of the node at the root of any subtree is
less than or equal to the value of either of its children is called as MIN heap.
 A heap is an ordered balance binary tree in which the value of the node at the root of any subtree is
greater than or equal to the value of either of its children is called as MAX heap.
6.List any four applications Tree.
 Manipulate hierarchical data like dictionaries.
 Searching is easily performed.
 Can store complex and structured data.
 Listing directories,files,etc.,
7.Define Hashing.
 Hashing is an important key –to address transformation technique fro searching,inserting and
deleting values in a list.
 Hashing is used to index and retrieve items in a database because it is faster to find the items using
the shorter hashed key than to find using the original value.
8.List out the various techniques of hashing.
 Division method
 Mid-square method
 Multiplicative hash function
 Digit folding
9.What is rehashing?
 Rehashing is a technique in which the table is resized.That means the size of the table is doubled by
creating a new table.the rehashing required
 When table is completely full.
 With quadratic probing the table is filled half.
 When insertions fail due to overflow.
10. What are the applications of binary tree?
1. Binary tree is used in data processing.
2. File index schemes
3. Hierarchical database management system.
11. What are the different types of traversing?
The different types of traversing are
a. Pre-order traversal-yields prefix form of expression.
b. In-order traversal-yields infix form of expression.
c. Post-order traversal-yields postfix form of expression.
12. What is meant by binary search tree?
Binary Search tree is a binary tree in which each internal node x stores an element such that the element stored in the
left sub tree of x are less than or equal to x and elements stored in the right sub tree of x are greater than or equal to
x.
13. Define a heap. How can it be used to represent a priority queue?
 A priority queue is a different kind of queue, in which the next element to be removed is defined by
(possibly) some other criterion.
 The most common way to implement a priority queue is to use a different kind of binary tree,
called a heap. A heap avoids the long paths that can arise with binary search trees.
14. What is the various representation of a binary tree?
Tree Representation
 Array representation
 Linked list representation
15. Define Double Hashing.
Double Hashing is a collision-resolution technique used in open addressing category.
In double hashing, we apply a second hash function to x and probe at a distance of hash2 (x), 2hash2 (x)…………,
and so on.
16. What are applications of hashing?
The applications of hashing are,
● Compliers use hash table to keep track of declared variables on source code.
● Hash table is useful for any graph theory problem, where the nodes have real names instead of numbers.
● Hash tables are used in programs that play games.
● Online spelling checkers use hashing.
17. What is insertion sort?
 How many passes are required for the elements to be sorted ? one of the simplest sorting
algorithms is the insertion sort.
 Insertion sort consist of N-1 passes . For pass P=1 through N-1 , insertion sort ensures that the
elements in positions 0 through P-1 are in sorted order .
 It makes use of the fact that elements in position 0 through P-1 are already known to be in sorted
order .
18. Mention the types of sorting
● Internal sorting
● External sorting.
19. What is the length of the path in a tree?
The length of the path is the number of edges on the path. In a tree there is exactly one path form the root to each
node.
20. Define expression trees?
Leaves of an expression tree are operands such as constants or variable names and the other nodes contain operators.
PART –B
1.Explain the tree traversal techniques with an example.(Dec-2019)
2.What are expression trees.Write the procedure for constructing an expression tree.(Dec-2019)
3.How to insert and delete an element into binary search tree and writ down the code for the insertion
routine with an example.(Dec-2018)
4.Briefy explain the basic concept of hashing.(May-2019)
5.What is Hashing function?.Explain any four types of hashing functions.
6.Explain the following collision resolution strategies with examples.
i)Separate chaining ii)Linear probing iii)quadratic probing.(Dec-2015,May-2016,2017,2019)
7.Define binary search tree.Draw the binary search tree for the following
input.14,15,4,9,7,18,3,5,16,4,20,17,9,14,5.
8.What are the characteristics of good hashing functions?
9.Give the input {4371,1323,6173,4199,4344,9679,1989} and hash function h(x)=X(mod 10),show the
results for the following:
i)Open addressing hash table using linear probing.
ii)Open addressing hash table using quadratic probing.
iii)Open addressing hash table with second hash function h2(x)=7-(X mod 7).
10.Describe the binary search tree with an example.Write a iterative function to search for the key value in
binary search tree.
UNIT-5
SORTING AND SEARCHING TECHNIQUES
1. Differentiate between internal and external sorting.
Internal sorting External Sorting

 This is a type of sorting technique in  This is a sorting technique in which


which data resides on main memory of there is huge amount of data and it
computer resides on secondary storage devices
while sorting.

2.What is the need for sorting?


 Searching the desired data efficiently.
 Responding to the queries.
3.Give any two applications of sorting.
 The sorting is useful in database applications for arranging the data in desired order.
 In the dictionary like applications the data is arranged in sorted order.
 For searching the element from the list of elements,the sorting is required.
4.List the sorting algorithm which uses logarithmic time complexity.
The sorting algorithm which use the logarithmic time complexity are
o Quick sort
o Merge sort.
5.Compare Linear search and Binary search.
Linear search Binary search

 The linear search is a searching methods  The binary search is searching methods
in which the element is searched by in which the list is sub divide into two
scanning the entire list from first element sub-lists.
to the last.
 Many time entire list is searched  Only sub-List is searched fro searching
the key element.
 It is simple to implement  It involves computation for finding the
middle element
 It is less efficient searching method  It is an efficient searching method.

6. What are the three cases that arise during the left to right scan in quick sort?
1. I and j cross each other
2. I and j do not cross each other
3. I and j points the same position.
7. What is merge sort?
 The merge sort algorithm is a classic divide conquer strategy.
 The problem is divided into two arrays and merged into single array.
8. Mention some methods for choosing the pivot element in quick sort?
1. Choosing first element.
2. Generate random number.
3. Median of three.
9. Is the heap sort always better than the quick sort?
 No, the heap sort does not perform better than the quick sort. Only when array is nearly sorted to begin with
the heap sort algorithm gains an advantage and its worst performance of O (n2).
10. What is meant by linear search?
 Linear search or sequential search is a method for finding a particular value in a list that consists of checking
every one of its elements, one at a time and in sequence, until the desired one is found.
11. Define searching .
Searching refers to determining whether an element is present in a given list of elements or not. If the element is
present, the search is considered as successful, otherwise it is considered as an unsuccessful search. The choice of a
searching technique is based on the following factors a. Order of elements in the list i.e., random or sorted b. Size of
the list.
12. What is divide-and-conquer strategy?
• Divide a problem into two or more sub problems
• Solve the sub problems recursively
• Obtain solution to original problem by combining these solutions.
13. Mention the different ways to select a pivot element.
The different ways to select a pivot element are
• Pick the first element as pivot
• Pick the last element as pivot
• Pick the Middle element as pivot
• Median-of-three elements
• Pick three elements, and find the median x of these elements
• Use that median as the pivot.
• Randomly pick an element as pivot.
14. Which sorting algorithm is best if the list is already sorted? Why?
Insertion sort as there is no movement of data if the list is already sorted and complexity is of the order O(N).
15. How does insertion sort algorithm work?
In every iteration an element is compared with all the elements before it. While comparing if it is found that the
element can be inserted at a suitable position, then space is created for it by shifting the other elements one position
up and inserts the desired element at the suitable position. This procedure is repeated for all the elements in the list
until we get the sorted elements.
16. List the different sorting algorithms.
• Bubble sort
• Selection sort
• Insertion sort
• Shell sort
• Quick sort
• Radix sort
• Heap sort
• Merge sort.
17. Which of the following sorting methods would be especially suitable to sort alist L consisting of a
sorted list followed by a few “random” elements?
Quick sort is suitable to sort a list L consisting of a sorted list followed by a few “random” elements.
18. What is the need of external sorting?
External sorting is required where the input is too large to fit into memory. So external sorting Is necessary where
the program is too large.
19. Differentiate between merge sort and quick sort?
Merge sort quick sort
1. Divide and conquer strategy Divide and conquer strategy
2. Partition by position Partition by value.
20. What are the various factors to be considered in deciding a sorting algorithm?
Factors to be considered in deciding a sorting algorithm are,
1. Programming time
2. Executing time for program
3. Memory or auxiliary space needed for the programs environment.
PART –B
1.Explain binary searching with suitable example.
2.Write a C program to search a number with the given set of numbers using binary search.
3.Write about Linear search and explain the algorithm with example.
4.Write a function to perform merge sort. Give example.
5.Explain heap sort with example.
6.Discuss in briefly about the insertion sort with suitable example.(May-2019)
7.Write a routine for insertion sort.Sort the following sequence using insertion sort 3,10,4,2,8,6,5,1.
8.Consider following numbers,sort them using quick sort.Show all passes to sort the values in ascending
Order.
25,57,48,37,12,92,86,33.
9.Explain Heap sort with suitable example.(Dec-2012,May-2012)
10.Explain the concepts of Quick sort with algorithm and suitable example.

Sign of Subject Incharge Sign of HOD

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy