April 22, 2007

Data structure Questions-2

  1. Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements.?
  2. Parenthesis are never needed in prefix or postfix expressions. Why?
  3. How will inorder, preorder and postorder traversals print the elements of a tree?
  4. In which data structure, elements can be added or removed at either end, but not in the middle?
  5. How can you correct these errors?
  6. What do you mean by: Syntax Error, Logical Error, Runtime Error?
  7. Which data structure is needed to convert infix notations to post fix notations?
  8. What is the average number of comparisons in a sequential search?
  9. Which sort show the best average behavior?
  10. What is the average number of comparisons needed in a sequential search to determine the position of an element in an array of 100 elements, if the elements are ordered
  11. from largest to smallest?
  12. The element being searched for is not found in an array of 100 elements. What is the average number of comparisons needed in a sequential search to determine that the element is not there, if the elements are completely unordered?
  13. When will you sort an array of pointers to list elements, rather than sorting the elements themselves?
  14. A list is ordered from smaller to largest when a sort is called. Which sort would take the shortest time to execute?
  15. A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
  16. How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?

No comments:

Post a Comment