SlideShare una empresa de Scribd logo
1 de 2
Data Structures Questions and Answers
Q What are the different types of parameter passing ?
There are two methods of parameter passing –
1. Call by value - The parameters that are passed to the function are actual
values.
2. Call by reference - In call by reference the parameters are taken by reference.
Pointer variables are taken as parameters.

Q List uut and define performance measures of an algorithem.
Ans.: The performance of an algorithm can be measured by -
1. Time complexity : The amount of time taken by an algorithm to execute, is
called time complexity
2. Space complexity: The amount of space taken required by an algorithm, is called
space complexity.
The time and space complexities are denoted by asymptotic notations. Using these
two measures we can decide whether an algorithm is efficient or not.

Q What do you mean by the terms average case, best case and worst case time
complexity?
Ans : Average case : The time complexity which we get for certain set of input as a
average value then it is called the average case time complexity.
Best case : The time complexity which we get is very minimum for particular
inputs then it is called the best case time complexity.
Worst case : The time complexity which we get for certain inputs is maximum
then we call it as the worst case time complexity.

Q Give two examplts of non-linear data structures which are widly used.
Ans The widely used non-linear data structures are -
1. Trees
2 Graphs

Q What do you ' mean by linear data structure’?
Ans The linear data structure is a kind of data structure in which data is in sequential
manner. There is no hierarchy followed .

Examples of linear data structures are
 Arrays
 Linked lists
 Stacks

Q. Explain the term dynamic memory.
Ans The dynamic memory allocation means one can allocate the memory of required
size, as well as de allocate (free) it. So that freed memory can be utilized further.
Also the memory can be real1ocated.


Q Why the linked representation is preferred ?
Ans : There are various features of the linked list because of which the
linkedrepresentation is preferred.. They are liste as follows,
a) The memory allocation is dynamic. So the developer can allocate as well as
de allocate the memory. And so no wastage of memory is there.
b) Insertions and deletions of the data is easy.
c) Physically the data can be deleted.


Q What is the advantage of circular linked list?
Ans: In the circular linked list the next pointer of the last node points to the first
node of the linked list. So one can quickily access the first node when he is accessing
the last node which in turn improves the efficiency of the algorithm as compared to
the singly linked list.

Más contenido relacionado

La actualidad más candente

Text Analytics
Text AnalyticsText Analytics
Text Analytics
Ajay Ram
 

La actualidad más candente (20)

Sensing topics in Tweets
Sensing topics in TweetsSensing topics in Tweets
Sensing topics in Tweets
 
Kmeans
KmeansKmeans
Kmeans
 
Types of clustering and different types of clustering algorithms
Types of clustering and different types of clustering algorithmsTypes of clustering and different types of clustering algorithms
Types of clustering and different types of clustering algorithms
 
An improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracyAn improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracy
 
Clustering
ClusteringClustering
Clustering
 
Introduction to Linear Discriminant Analysis
Introduction to Linear Discriminant AnalysisIntroduction to Linear Discriminant Analysis
Introduction to Linear Discriminant Analysis
 
K means clustering
K means clusteringK means clustering
K means clustering
 
Document clustering and classification
Document clustering and classification Document clustering and classification
Document clustering and classification
 
Document Classification and Clustering
Document Classification and ClusteringDocument Classification and Clustering
Document Classification and Clustering
 
Hierarchical clustering
Hierarchical clustering Hierarchical clustering
Hierarchical clustering
 
K-Means clustring @jax
K-Means clustring @jaxK-Means clustring @jax
K-Means clustring @jax
 
Clustering
ClusteringClustering
Clustering
 
"k-means-clustering" presentation @ Papers We Love Bucharest
"k-means-clustering" presentation @ Papers We Love Bucharest"k-means-clustering" presentation @ Papers We Love Bucharest
"k-means-clustering" presentation @ Papers We Love Bucharest
 
Text Analytics
Text AnalyticsText Analytics
Text Analytics
 
Complexity
ComplexityComplexity
Complexity
 
Textmining Retrieval And Clustering
Textmining Retrieval And ClusteringTextmining Retrieval And Clustering
Textmining Retrieval And Clustering
 
KNN - Classification Model (Step by Step)
KNN - Classification Model (Step by Step)KNN - Classification Model (Step by Step)
KNN - Classification Model (Step by Step)
 
Normalisation by vmb
Normalisation by vmbNormalisation by vmb
Normalisation by vmb
 
05 k-means clustering
05 k-means clustering05 k-means clustering
05 k-means clustering
 
Cluster analysis
Cluster analysisCluster analysis
Cluster analysis
 

Similar a Data structue q & a

Introduction to DS.pptx
Introduction to DS.pptxIntroduction to DS.pptx
Introduction to DS.pptx
OnkarModhave
 

Similar a Data structue q & a (20)

Data structures Basics
Data structures BasicsData structures Basics
Data structures Basics
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
 
VCE Unit 01 (1).pptx
VCE Unit 01 (1).pptxVCE Unit 01 (1).pptx
VCE Unit 01 (1).pptx
 
Data structure introduction
Data structure introductionData structure introduction
Data structure introduction
 
Introduction to DS.pptx
Introduction to DS.pptxIntroduction to DS.pptx
Introduction to DS.pptx
 
Mit102 data & file structures
Mit102  data & file structuresMit102  data & file structures
Mit102 data & file structures
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.ppt
 
Study on Sorting Algorithm and Position Determining Sort
Study on Sorting Algorithm and Position Determining SortStudy on Sorting Algorithm and Position Determining Sort
Study on Sorting Algorithm and Position Determining Sort
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 
CSE 443 (1).pptx
CSE 443 (1).pptxCSE 443 (1).pptx
CSE 443 (1).pptx
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 
Dynamic Memory & Linked Lists
Dynamic Memory & Linked ListsDynamic Memory & Linked Lists
Dynamic Memory & Linked Lists
 
U nit i data structure-converted
U nit   i data structure-convertedU nit   i data structure-converted
U nit i data structure-converted
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Mi0034 database management system
Mi0034   database management systemMi0034   database management system
Mi0034 database management system
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
 
Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdf
 
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
Unit I- Data structures Introduction, Evaluation of Algorithms, Arrays, Spars...
 

Data structue q & a

  • 1. Data Structures Questions and Answers Q What are the different types of parameter passing ? There are two methods of parameter passing – 1. Call by value - The parameters that are passed to the function are actual values. 2. Call by reference - In call by reference the parameters are taken by reference. Pointer variables are taken as parameters. Q List uut and define performance measures of an algorithem. Ans.: The performance of an algorithm can be measured by - 1. Time complexity : The amount of time taken by an algorithm to execute, is called time complexity 2. Space complexity: The amount of space taken required by an algorithm, is called space complexity. The time and space complexities are denoted by asymptotic notations. Using these two measures we can decide whether an algorithm is efficient or not. Q What do you mean by the terms average case, best case and worst case time complexity? Ans : Average case : The time complexity which we get for certain set of input as a average value then it is called the average case time complexity. Best case : The time complexity which we get is very minimum for particular inputs then it is called the best case time complexity. Worst case : The time complexity which we get for certain inputs is maximum then we call it as the worst case time complexity. Q Give two examplts of non-linear data structures which are widly used. Ans The widely used non-linear data structures are - 1. Trees 2 Graphs Q What do you ' mean by linear data structure’? Ans The linear data structure is a kind of data structure in which data is in sequential manner. There is no hierarchy followed . Examples of linear data structures are  Arrays  Linked lists  Stacks Q. Explain the term dynamic memory. Ans The dynamic memory allocation means one can allocate the memory of required size, as well as de allocate (free) it. So that freed memory can be utilized further. Also the memory can be real1ocated. Q Why the linked representation is preferred ?
  • 2. Ans : There are various features of the linked list because of which the linkedrepresentation is preferred.. They are liste as follows, a) The memory allocation is dynamic. So the developer can allocate as well as de allocate the memory. And so no wastage of memory is there. b) Insertions and deletions of the data is easy. c) Physically the data can be deleted. Q What is the advantage of circular linked list? Ans: In the circular linked list the next pointer of the last node points to the first node of the linked list. So one can quickily access the first node when he is accessing the last node which in turn improves the efficiency of the algorithm as compared to the singly linked list.