1. For multilple choice questions on data
structures
http://www.avatto.com/gate/computer-
science/mcqs/data-
structure/questions/17/1.html
Also find MCQ on computer science at
http://www.avatto.com
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’?
2. 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.