Data Structure Interview Question and Answers

6. What are the goals of Data Structure?
 
  • It must rich enough in structure to reflect the actual relationship of data in real world.
  • The structure should be simple enough for efficient processing of data.
7. What is the difference between a Stack and an Array?
 
    Stack
  • Stack is a dynamic object whose size is constantly changing as items are pushed and popped .
  • Stack may contain different data types.
  • Stack is declared as a structure containing an array to hold the element of the stack, and an integer to indicate the current stack top within the array.
  • Stack is a ordered collection of items.
  • Array
  • Array is an ordered collection of items.
  • Array is a static object.
  • It contains same data types.
  • Array can be home of a stack i.e. array can be declared large enough for maximum size of the stack.
8. What is sequential search?
 
  • In sequential search each item in the array is compared with the item being searched until a match occurs.
  • It is applicable to a table organized either as an array or as a linked list.
9. What are the disadvantages array implementations of linked list?
  The no of nodes needed can’t be predicted when the program is written.
The no of nodes declared must remain allocated throughout its execution.
10. What is a priority queue?
  The priority queue is a data structure in which the intrinsic ordering of the elements.
12345

Page 2 of 5