Data Structures VIVA Questions and Answers
Data Structures VIVA Questions and Answers
Wo
rld
TU
JN
Wo
rld
each element in list contains a field, called a link or pointer which contains the address of the next element
Successive elements need not occupy adjacent space in memory.
11. Can we apply binary search algorithm to a sorted linked list, why?
No we cannot apply binary search algorithm to a sorted linked list, since there is no way of indexing the middle
element in the list. This is the drawback in using linked list as a data structure.
12. What do you mean by free pool?
Pool is a list consisting of unused memory cells which has its own pointer.
TU
When new data is to be inserted into the data structure but there is no available space i.e. free storage list is
empty this situation is called overflow.
When we want to delete data from a data structure that is empty this situation is called underflow.
15. What are the disadvantages array implementations of linked list?
1.The no of nodes needed cant be predicted when the program is written.
2.The no of nodes declared must remain allocated throughout its execution
JN
19. What are the disadvantages of representing a stack or queue by a linked list?
i) A node in a linked list (info and next field) occupies more storage than a corresponding element in an array.
ii) Additional time spent in managing the available list.
20. What is dangling pointer and how to avoid it?
After a call to free(p) makes a subsequent reference to *p illegal, i.e. though the storage to p is freed but the
value of p(address) remain unchanged .so the object at that address may be used as the value of *p (i.e. there is
no way to detect the illegality).Here p is called dangling pointer.
To avoid this it is better to set p to NULL after executing free(p).The null pointer value doesnt reference a
storage location it is a pointer that doesnt point to anything.
Wo
rld
JN
TU
Data Structures VIVA Questions and Answers :26. What are the issues that hamper the efficiency in sorting a file?
The issues are
i) Length of time required by the programmer in coding a particular sorting program
ii) Amount of machine time necessary for running the particular program
iii)The amount of space necessary for the particular program .
27. Calculate the efficiency of sequential search?
The number of comparisons depends on where the record with the argument key appears in the table
Wo
rld
TU
Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation
JN
31. What are the major data structures used in the following areas : network data model & Hierarchical data
model?
RDBMS Array (i.e. Array of structures)
Network data model Graph
Hierarchical data model Trees
32. If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect
them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of
storing pointer to any type as it is a generic pointer type.
33. Minimum number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for storing priorities.
34. What is the data structures used to perform recursion?
Stack. Because of its LIFO (Last In First Out) property it remembers its caller so knows whom to return when
the function has to return. Recursion makes use of system stack for storing the return addresses of the function
calls.
Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent
iterative procedures are written, explicit stack is to be used.
35. What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?
Polish and Reverse Polish notations.
36. Convert the expression ((A + B) * C (D E) ^ (F + G)) to equivalent Prefix and Postfix notations?
1.Prefix Notation:
^ * +ABC DE + FG
2.Postfix Notation:
AB + C * DE FG + ^
Wo
rld
39. List out few of the applications that make use of Multilinked Structures?
Sparse matrix, Index generation.
TU
41. What is the type of the algorithm used in solving the 8 Queens problem?
Backtracking
42. In an AVL tree, at what condition the balancing is to be done?
If the pivotal value (or the Height factor) is greater than 1 or less than 1.
JN
43. In RDBMS, what is the efficient data structure used in the internal storage representation?
B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This
corresponds to the records that shall be stored in leaf nodes.
45. One of the following tree structures, which is, efficient considering space and time complexities?
a) Incomplete Binary Tree.
b) Complete Binary Tree.
c) Full Binary Tree.
b) Complete Binary Tree.
By the method of elimination:
Full binary tree loses its nature when operations of insertions and deletions are done. For incomplete binary
trees,
extra property of complete binary tree is maintained even after operations like additions and deletions are done
on it.
Wo
rld
JN
TU