Practice Set III: Data Structures and Algorithms (47 Questions)

01. Recursive procedures are implemented by

02. A linear list of elements in which deletion can be done from one end (front) and Insertion can take place only at the other end (rear) is known as

03. A linear list in which elements can be added or removed at either end but not in the middle is known as

04. A list of integers is read in, one at a time, and a binary search tree is constructed. Next the tree is traversed and the integers are printed. Which traversal would result in a printout which duplicates the original order of the list of integers

05. The five items : A,B,C,D and E are pushed in a stack, one after the other starting from A. The stack is popped four times and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. The popped item is

06. The time required to search an element in a binary search tree having n elements is

07. Consider that n elements are to be sorted. What is the worst case time complexity of bubble sort

08. Consider that n elements are to be sorted. That is the worst case time complexity of shell sort

09. What is the worst case time complexity of straight insertion sort algorithm to sort n elements

10. What is the worst case time complexity of binary insertion sort algorithm to sort n elements

11. If each node in a tree has value greater than every value in its left subtree and has value less than every value in its right subtree, the tree is known as

12. Which of the following procedure is the slowest

13. The infix expression A+(B-C)*D is correctly represented in prefix notation as

14. What is the postfix expression of the following tree represented in prefix notation as

A+BC-D*

15. A list of data items usually words or bytes, with the accessing restriction that elements can be added or removed at one end of the list only, is known as

16. In what order the elements of a pushdown stack are accessed

17. Which of the following is a tabular listing of contents of certain registers and Memory locations at different times during the execution of a program

18. How many values can be held by an array A(-1..1, 1..m)

19. An undirected graph with n vertices and e edges are represented by Adjacency Matrix. What is the time required to determine the whether the graph is connected

20. An undirected graph with n vertices and e edges are represented by adjacency Matrix. What is the time required to determine the degree of any vertex

21. A directed graph with n vertices and e edges are represented by adjacency Matrix. What is the time required to determine the in-degree of any vertex

22. Which of the following statements is false

23. A graph G with n nodes is bipartite if it contains

24. In what tree, for every node the height of its left subtree and right subtree differ atleast by one

25. Which of the following sorting method is stable

26. A complete binary tree with the property that the value at each node is atleast as large as the values at its children is known as

27. The time required to find the shortest path in a graph with n vertices and e edges is

28. In which of the following sorting algorithm the number of comparision needed is the minimum if the items are initially in reverse order and is the maximum if the items are in order

29. Which of the following best describes sorting

30. The order of magnitude of the worst case performance of the binary search over n elements is

31. A search procedure which associates an address with a key value and provides a Mechanism for dealing with two or more values assigned to the same address is called

32. The order of magnitude of the worst case performance of a hash coded search over n elements is

33. A characteristic of the data that binary search uses but the linear search ignores is

34. A sort which compares adjacent elements in a list and switches where necessary is

35. A full binary tree with n leaves contains

36. A full binary tree with n leaves contains

37. Which of the following sorting algorithms does not have the worst case running time of O(n²)

38. Which of the following sorting algorithms has a worst case running time of O(n²) where n<=100

39. What is the maximum number of fields with each node of doubly linked list

40. Given two sorted list of size m and n respectively. The number of comparisons needed in the worst case by the merge sort algorithm will be

41. Preorder is nothing but

42. Which traversal techniques lists the nodes of a binary search tree in ascending order

43. The initial configuration of queue is a,b,c,d (a at the front). To get the configuration d,c,b,a one needs a minimum of

44. The number of swappings need to sort the numbers 8,22,7,9,31,19,5,13 in Ascending order, using bubble sort is

45. There are four algorithms A1, A2, A3, A4 with time complexities O(log n), O(n log n), O(n log n), O(n / log n) respectively. Which is the best algorithm

46. Queues serve a major role in

47. What is the number of nodes in a complete binary tree of level 5