
Data Structures
1) What are the various kinds of sorting techniques? Which is has best case?
Ans: Bubble sort, Quick sort, Insertion sort, Selection sort, Merge sort, Heap sort. Among
the sorting algorithms quick sort is the best one.
2) What is linear hashing?
Ans: In linear hashing, the table is gradually expanded by splitting the buckets in order
until the table has doubled its size.
3) When can you tell that a memory leak will occur?
Ans: A memory leak occurs when a program loses the ability to free a block of
dynamically allocated memory.
4) In an AVL tree , at what condition the balancing is to be done?
Ans: If the balance factor of any node is other than 0 or 1 or -1 then balancing is done.
5) What is precision?
Ans: Precision refers the accuracy of the decimal portion of a value. Precision is the
number of digits allowed after the decimal point.
6) How is the front of the queue is calculated?
Ans: The front of the queue is calculated by front = (front+1) % size.
7) In RDBMS, what is the efficient data structure used in the internal storage
representation?
Ans: 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.
8) Minimum number of queues needed to implement the priority queue?
Ans: Two. One queue is used for actual storing of data and another for storing priorities.
9) Is Pointer a variable?
Ans: Yes, a pointer is a variable and can be used as an element of a structure and as an
attribute of a class in some programming languages such as C++, but not Java. However,
the contents of a pointer is a memory address of another location of memory, which is
usually the memory address of another variable, element of a structure, or attribute of a
class.
10) Name two desirable properties of hashing functions.
Ans: Some of the desirable properties of a hashing function are speed and the generation
of addresses uniformly.
From: Sushanth Bhat,
Team No.2,
4NM07CS125