In the name of ALLAH, the most beneficient, the most merciful

Data Structures (CS301)

Multiple Choice Questions (MCQs)

Objective Questions

  1. If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is ___________.

    1. N
    2. N2
    3. Nlog2N
    4. log2N
  2. If we have 1000 sets each containing a single different person. Which of the following relation will be true on each set:

    1. Reflexive
    2. Symmetric
    3. Transitive
    4. Associative
  3. Which one of the following is NOT the property of equivalence relation?

    1. Reflexive
    2. Symmetric
    3. Transitive
    4. Associative
  4. Which property of equivalence relation is satisfied if we say:
    Ahmad is cousin of Ali and Ali is also cousin of Ahmad

    1. Reflexivity
    2. Symmetry
    3. Transitivity
    4. All of the given
  5. Which property of equivalence relation is satisfied if we say:
    Ahmad R(is related to) Ahmad

    1. Reflexivity
    2. Symmetry
    3. Transitivity
    4. All of the given
  6. If there are N external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?

    1. N -1
    2. N+1
    3. N+2
    4. N
  7. If there are N internal nodes in a binary tree then what will be the no. of external nodes in this binary tree?

    1. N -1
    2. N
    3. N +1
    4. N +2
  8. If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?

    1. 23
    2. 24
    3. 22
    4. 21
  9. A binary tree with 24 internal nodes has ________ external nodes.

    1. 22
    2. 23
    3. 48
    4. 25
  10. If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?

    1. 54
    2. 57
    3. 56
    4. 55
  11. If a tree has 50 nodes, then the total edges/links in the tree will be:

    1. 55
    2. 51
    3. 50
    4. 49
  12. The percolateDown procedure will move the smaller value ________ and bigger value ________.

    1. left, right
    2. right, left
    3. down, up
    4. up, down
  13. Suppose there are 100 elements in an equivalence class, so initially there will be 100 trees. The collection of these trees is called

    1. Cluster
    2. Class
    3. Forest
    4. Bunch
  14. For a perfect binary tree of height h, having N nodes, the sum of hights of nodes ia ________.

    1. N - h - 1
    2. N - 1
    3. N - 1 + h
    4. N - (h - 1)
  15. given the values are the array representation of heap:
    12 23 26 31 34 44 56 64 78 100
    What is the 5th smallest element in the given heap?

    1. 31
    2. 34
    3. 44
    4. 56
  16. Sorting procedure normally takes ________ time.

    1. NLogN
    2. 2N
    3. N*N*N
    4. N
  17. If there are 100 elements in an equivalence class then we will have ________ sets initially.

    1. 50
    2. 100
    3. 1000
    4. 80
  18. The expression
    if (! heap ->isEmpty() )
    checks

    1. Heap is empty
    2. Heap is full
    3. Heap is not empty
    4. Not a valid expression
  19. If ahmad is boss of ehsan and ehsan is boss of umer then ahmad is also boss of umer.
    The above mentioned relation is ________.

    1. Reflexive
    2. Symmetry
    3. Transitive
    4. None of the given
  20. If there are 100 elements in a heap, and 100 deleteMin operation are performed, will get ________ list.

    1. Sorted
    2. Unsorted
    3. Nonlinear
    4. None of the given
  21. If a tree has 20 edges/links, then the total number of nodes in the tree will be:

    1. 19
    2. 20
    3. 21
    4. Can't be determined
  22. For a perfect binary tree of height 4, What will be the sum of hights of nodes?

    1. 31
    2. 30
    3. 27
    4. 26
  23. The total number of nodes on 10th level of a perfect binary tree are :

    1. 256
    2. 512
    3. 1024
    4. Can't be determined
  24. Heap can be used to implement

    1. Stack
    2. Linked list
    3. Queue
    4. Priority Queue
  25. What is the time complexity of binary search with iteration?

    1. O(nlogn)
    2. O(n2)
    3. O(n)
    4. O(logn)
  26. Which of the following possible operation are performed on Table ADT?

    1. Insert, Remove
    2. Find, Remove
    3. Insert, Find
    4. Insert, Find, Remove
  27. Which of the is NOT true regarding the maze generation?

    1. Randomly remove walls until the entrance and exit cells are in same set.
    2. Removing a wall is the same as doing a union operation
    3. Remove a randomly chosen wall if the cells it separates are alreadly in same set
    4. Do not remove a randomly chosen wall if the cells it separates are alreadly in same set.
  28. The union operation is based on size or weight but the reducing the in-between links or path compression from ________ to the ________ is done by the find method.

    1. roots, node
    2. nodes, root
    3. root, root
    4. node, node
  29. During the union by size method, all the array element initialized to -1 shows:

    1. Tree is complete now
    2. Initial condition of tree
    3. Every tree has two elements each
    4. None of given
  30. Which of the following is true regarding the maze generation?

    1. Randomly remove walls until the entrance and exit cells are in same set.
    2. Removing a wall is the same as doing a union operation
    3. Do not remove a randomly chosen wall if the cells it separates are already in the same set
    4. All of the given
  31. Which of the following statement is NOT correct regarding Table ADT?

    1. In a table, the type of information in columns may be different.
    2. A table consists of deveral columns known as entities
    3. The row of a table is called a record
    4. A major use of table is in databases where we build and use tables for keeping information
  32. What is the hash function used in linear probing?

    1. hi(x)=hash(x) mod table size
    2. hi(x)=(hash(x) + f(i^2)) mod table size
    3. hi(x)= (hash(x)+ f(i)) mod table size
    4. hi(x)= X mod 17
  33. Suppose there is an image of 7 * 7, now we will have matrix of ________ rows and ________ columns.

    1. 7, 7
    2. 49, 49
    3. 100, 100
    4. 8, 8
  34. Suppose there is an image segmented into pixels. Each pixel has ________ neighbour(s).

    1. 0
    2. 4
    3. 8
    4. 16
  35. Which of the following is NOT true regarding the maze generation?

    1. Randomly remove walls until the entrance and exit cells are in same set
    2. Do not remove a randomly chosen wall if the cells it separates are already in the same set
    3. Remove a randomly chosen wall if the cells it separates are already in the same set
    4. Removing a wall is the same as doing a union operation
  36. A hash function returns a ________ value.

    1. Integer
    2. Double
    3. Float
    4. Char
  37. Binary Search can be categorized into which of following?

    1. Greedy algorithm
    2. Dynamic programming
    3. Divide and conquer
    4. Brute Force technique
  38. If a hash function returns 4 for more than one value, this condition is called ________.

    1. Merging
    2. Collision
    3. Mapping
    4. Clustering
  39. What is the depth of any tree if the union operation is performed by height?

    1. O(N)
    2. O(N log N)
    3. O(log N)
    4. O(M log N)
  40. Which of the following is NOT an open addressing technique to resolve collisions?

    1. Quadratic probing
    2. Double hashing
    3. Cubic probing
    4. Linear probing
  41. In 1990, Bill pugh proposed an enhancement on linked lists and the new data structure was termed as

    1. Linked list
    2. B-Tree
    3. Skip list
    4. Spelling checker
  42. Which one of the following is NOT true regarding the skip list?

    1. Each list Si contains the special keys + infinity and -infinity
    2. List S0 contains the keys of S in non-decreasing order
    3. List Sh contains only the n special keys
    4. Each list is a subsequence of previous one
  43. During union by size method, which data structure is used to improve the balancing of tree?

    1. Array
    2. Stack
    3. Linked List
    4. Tree
  44. Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7. Assuming the hash table is initially empty, which of the following is the contents of table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? NOte that '_' denotes an empty location in the table.

    1. 8, _, _, _, _, _, 10
    2. 1, _, _, _, _, _, 3
    3. 1, 10, 8, _, _, _, 3
    4. 1, 8, 10, _, _, _, 3
  45. The array in binary search is sub divided ________.

    1. Once
    2. Twice
    3. N time
    4. Untill a sublist is no more divisible
  46. Suppose a hash function returns 6 for the given value. At which indexof array the value will be saved?

    1. 0
    2. 5
    3. 6
    4. 7
  47. The total number of nodes on 5th level of a perfect binary tree are :

    1. 16
    2. 15
    3. 31
    4. 32
  48. If we want to find median of 50 elements, then after applying buildHeap methd, how many times deleteMin method will be called?

    1. 5
    2. 25
    3. 35
    4. 50
  49. Suppose there are a set of fruits and a set of vegetables. Both sets are ________ sets.

    1. Disjoint
    2. Subsets
    3. Whole
    4. Equal
  50. Which of the following properties are satisfied by Equivalence relationship?

    1. Reflexive, Symmetric
    2. Reflexive, Transitive
    3. Symmetric, transitive
    4. Reflexive, Symmetric and Transitive
  51. Which of the following heap method lowers the value of key at position 'p' by the amount 'delta'?

    1. increaseKey(p,delta)
    2. decreaseKey(p,delta)
    3. percolateDown(p,delta)
    4. remove(p,delta)
  52. given the values are the array representation of heap:
    12 23 26 31 34 44 56 64 78 100
    If we perform 4 deleteMin operations, the last element deleted is ________.

    1. 31
    2. 34
    3. 44
    4. 56
  53. If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad is also cousin of Asad. This statement has the following property

    1. Reflexivity
    2. Symmetry
    3. Transitivity
    4. All of the given
  54. If we want to find 3rd minimum element from an array of elements, then after applying buildHeap method, how many times deleteMin method will be called?

    1. 1
    2. 2
    3. 3
    4. 4
  55. If the height of a perfect binary tree is 4. What will be the total number of nodes in it?

    1. 15
    2. 16
    3. 31
    4. 32
  56. A table consists of several columns, known as

    1. Entity
    2. Tuple
    3. Fields
    4. Record
  57. The expression
    if (! heap ->isFull() )
    check

    1. Heap is not empty
    2. Heap is not full
    3. Heap is empty
    4. Heap is full
  58. If unions are done by weight (size), the depth of any element is never greater than

    1. log 3n
    2. log2 n
    3. n log2 n
    4. log n*n
  59. Searching an element in an AVL tree takes maximum _______ time (where n is number of nodes in AVL tree).

    1. Log2(n+1)
    2. Log2(n+1) -1
    3. 1.44 Log2n
    4. 1.66 Log2n
  60. Every AVL is ___________.

    1. Binary Tree
    2. Complete Binary Tree
    3. Binary Search Tree
    4. None of the given
  61. Every AVL is ___________.

    1. Ternary Tree
    2. Complete Binary Tree
    3. Heap
    4. Binary Search Tree
  62. The easiest case of deleting a node from BST is the case in which the node to be deleted _________.

    1. Is a leaf node
    2. Has left subtree only
    3. Has right subtree only
    4. Has both left and right subtree
  63. Consider the following function:
    void test_a(int n)
    {
    cout << n << " ";
    if (n>0)
    test_a(n-2);
    }

    What is printed by the call test_a(4)?

    1. 4 2 0
    2. 0 2 4
    3. 0 2
    4. 2 4
  64. A binary tree of N nodes has _____________ .

    1. Log10 N levels
    2. Log2 N levels
    3. N / 2 levels
    4. N x 2 levels
  65. _________ only removes items in reverse order as they were entered.

    1. Stack
    2. Queue
    3. Both of the given
    4. None of the given
  66. What will be postfix expression of the following infix expression?
    Infix Expression: a+b*c-d

    1. ab+c*d-
    2. abc*+d-
    3. abc+*d-
    4. abcd+*-
  67. For compiler, a postfix expression is easier to evaluate than infix expression?

    1. True
    2. False
  68. Consider the following pseudo code
    declare a stack of characters
    while ( there are more characters in the word to read )
    {
    read a character
    push the character on the stack
    }
    while ( the stack is not empty )
    {
    pop a character off the stack
    write the character to the screen
    }

    What is written to the screen for the input "apples"?

    1. selpa
    2. selppa
    3. apples
    4. aaappppplleess
  69. Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure?

    1. Linked List
    2. Stack
    3. Queue
    4. Tree
  70. A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.

    1. True
    2. False
  71. Each node in singly link list has,

    1. 1 pointer
    2. 2 pointers
    3. 3 pointers
    4. 4 pointers
  72. Parameters in function call are passed using,

    1. Stack
    2. Queue
    3. Binary Search Tree
    4. AVL Tree
  73. The ________ method of list data structure removes the element residing at the current position

    1. Add
    2. Next
    3. Remove
    4. Find
  74. Insertion in a linked list can be done at

    1. Front only
    2. Back only
    3. Somewhere in middle only
    4. Front, Back and somewhere in the middle
  75. An array is a group of ________ memory locations.

    1. Scattered
    2. Isolated
    3. Random (non-consecutive)
    4. Consecutive
  76. Which of the following applications may use a stack?

    1. Accessing a shadred resource
    2. Parentheses balancing program
    3. Buffering messages
    4. Waiting list
  77. Consider the following expression:
    x - y * a + b / c
    Which of the following is a correct equivalent expression for the above?

    1. x y -a * b +c /
    2. x *y a - b c / +
    3. x y a * - b c / +
    4. x y a * - b/ + c
  78. Non-recursive calls are faster than which of the following calls?

    1. Parameterized
    2. Recursive
    3. Function
    4. Non-Function
  79. The balance of a node is the result of "height of left subtree" ________ "height of right subtree".

    1. Plus
    2. Minus
    3. Multiply
    4. Divided by
  80. A complete binary tree having "N" nodes consists of ________ Levels.

    1. Log2 (N+1) -1
    2. Log2 (N-1) -1
    3. Log2 (N+1) +1
    4. Log2 (N-1) +1
  81. In the poat-order traversal of a binary search tree, nodes process as:

    1. Left-subtree, Right-subtree, Root
    2. Rightt-subtree, Root, Left-subtree
    3. Left-subtree, Root, Right-subtree
    4. Rightt-subtree, Left-subtree, Root
  82. The simplest case in a BST to delete a node is:

    1. When the node, that is to be deleted is root node
    2. When the node, that is to be deleted has both left and right child
    3. When the node, that is to be deleted has only one child
    4. When the node, that is to be deleted is a leaf node
  83. If class A defines class B as its friend, then:

    1. Class A can access private members of Class B
    2. Class B can access only the public members of Class A
    3. Class A can access only the public members of Class B
    4. Class B can access private members of Class A
  84. In the statement int& a=b;

    1. a and b pointing to two different memory location
    2. a and b are two different names of the same memory location
    3. a and b are two different variable names
    4. b hold the address of variable a
  85. The main use of AVL tree is:

    1. Searching of data
    2. Storing of data
    3. Insertion of data
    4. Security of data
  86. In simple implementation of stack, isFull() method is used due to ________.

    1. Limitation of array
    2. Strength of array
    3. Linked list connectivity
    4. Complexity of linked list
  87. Write in postfix form 5 * (9 - 7)

    1. 5 (9 7 -) *
    2. 5 9 * 7 -
    3. 5 9 7 - *
    4. 5 (9 7 -)
  88. What will be result of following postfix expression?

    1 2 3 * + 2 -

    1. 3
    2. 4
    3. 5
    4. 10
  89. An array x of 100 integers is declared as

    1. int x = [100];
    2. int x[100];
    3. integer array x = 100;
    4. integer x [] = 100;
  90. What is the maximum depth of recursive calls a function may make?

    1. 1
    2. 2
    3. n (where n is the argument)
    4. There is no fixed maximum
  91. A Linear Data Structure is the data structure in which data elements are arranged in a sequence or a linear list. Which of the following is Non Linear Data Structure?

    1. Arrays
    2. Linked Lists
    3. Binary Search Trees
    4. Stack
  92. The new operation in C++ for dynamically allocating memory returns,

    1. Size of the memory it has allocated
    2. Pointer to the memory it has allocated
    3. Both size and pointer to the memory it has allocated
    4. Value of the memory it has allocated
  93. In ________, a programmer uses two pointers in the node, i.e. one to point to next node and the other to point to the previous node.

    1. Linked list
    2. Doubly-linked list
    3. Array
    4. Structure
  94. The expression AB+C* is called?

    1. Prefix expression
    2. Postfix expression
    3. Infix expression
    4. Prefix and Infix expression
  95. Consider the function X as under
    int X (int& Value)
    {
    return Value;
    }
    Now a and b are integers in a calling function. Which one of the following is a valid call to the above function X?

    1. a = X(b);
    2. a = X(&b);
    3. a = X(*b);
    4. a = X(&*b);
  96. Each node in Binary Search Tree has

    1. 1 pointer
    2. 2 pointers
    3. 3 pointers
    4. 4 pointers
  97. Suppose n is the number of nodes in a complete Binary Tree, then maximum steps required for a search operation are

    1. Log2 (n+1) -1
    2. Log2 (n+1)
    3. Log2 (n) -1
    4. Log2 (n)
  98. The next field in the last node of a singly-linked list is set to ________.

    1. NAN
    2. 1
    3. 'NULL
    4. -1
  99. A queue where the dequeue operation does not depend upon FIFO, is called:

    1. enqueue
    2. simple queue
    3. stack
    4. priority queue
  100. a * (b+c)-d is an example of ________ expression.

    1. infix
    2. prefix
    3. postfix
    4. allfix
  101. Which one of the following calling methods does not change the original value of the argument in the calling function?

    1. Call by passing the value of the argument
    2. Call by passing reference of the argument
    3. Call by passing the address of the argument
    4. Call by passing pointer of the argument
  102. Which of the following statement is NOT true for reference variable?

    1. Once a reference is created, it cannot be later made to reference another object.
    2. Reference cannot be NULL
    3. References can be uninitialized.
    4. It is not possible to refer directly to a reference object after it is defined.
  103. Each operator in a postfix expression refers to the previous ________ operand(s).

    1. One
    2. Two
    3. Three
    4. Four
  104. Which one of the following statement is correct?

    1. Array size is fixed once it is created
    2. Link List size is fixed once it is created
    3. Binary Search Tree size is fixed once it is created
    4. AVL Tree size is fixed once it is created
  105. Linked list always contains elements that can be described as,

    1. Redundant
    2. Recursive
    3. Self-referential
    4. Bidirectional
  106. One difference between a queue and a stack is

    1. Queues require dynamic memory, but stacks do not.
    2. Stacks require dynamic memory, but queues do not.
    3. Queues use two ends of the structure, stacks use only one.
    4. Stacks use two ends of the structure, queues use only one.
  107. Stack and Queue can be implemented using ________.

    1. Singly Link List
    2. Binary Tree
    3. Binary Search Tree
    4. AVL Tree
  108. New items are added at the ________ of the stack.

    1. Bottom
    2. Middle
    3. Top
    4. Center
  109. ________ is the stack characteristic but ________ was implemented because of the size limitation of the array.

    1. isFull(), isEmpty()
    2. pop(), push()
    3. isEmpty(), isFull()
    4. push(), pop()
  110. The difference between a "Binary Tree (BT)" and a "Binary Search Tree (BST)" is that,

    1. A BST has two children per node whereas a BT can have none, one or two children per node
    2. In BST nodes are inserted based on the values they contain
    3. In BT nodes are inserted based on the values they contain
    4. There is no difference
  111. Which of the following operations returns "most recently entered value" from the stack?

    1. Push
    2. Recent
    3. Top
    4. First
  112. Which of the following is correct about AVL Tree?

    1. It is identical to BST except height of the left and right subtrees can differ by at least 1.
    2. It is identical to BST except height of the left and right subtrees must differ by at least 1.
    3. It is not identical to BST, it is totally different kind of tree.
    4. It is identical to BST except height of the left and right subtrees can differ by at most 1.
  113. In the call by ________ methodology, a copy of the object is passed to the called function.

    1. Reference
    2. Value
    3. Reference & Value
    4. Copy of the object can not be passed
  114. Recursive call of a function use ________ data structure.

    1. Linked List
    2. Queue
    3. Stack
    4. Table
  115. The variables which are destroyed automatically when a function's execution ends are:

    1. Global variables
    2. Local variables defined inside function body
    3. Variables (objects) defined inside function body dynamically
    4. Variables (objects) defined inside function body statically
  116. The worst case of searching in binary search tree (BST) is:

    1. When the data inserted in BST is sorted
    2. When the height of left sub-tree is greater than right sub-tree
    3. When the height of right sub-tree is greater than left sub-tree
    4. When the tree is balanced
  117. What will be the value of root of an AVL and BST if built from the same data?

    1. Same
    2. Different in some cases
    3. Root of AVL is square of root of BST
    4. None of the given
  118. What will be the postfix expression of following infix expression?
    A*B/C+D-E

    1. A B / C * D + E -
    2. A B * C / D + E -
    3. A B * C + D E / -
    4. A B + C D / + E -
  119. Leaf node of binary search tree contains ________.

    1. One Null pointer
    2. Three Null pointers
    3. Two Null pointers
    4. All of the given
  120. Each node in doubly link list has

    1. 1 pointer
    2. 2 pointers
    3. 3 pointers
    4. 4 pointers
  121. For reference variables, ________ sign is used.

    1. ampersand
    2. asterisk
    3. sigma
    4. dollar
  122. For searching a particular number in Binary Search Tree (if it is not present), the maximum number of comparisons will be ________ comparison at each level.

    1. 1
    2. 2
    3. 3
    4. 4
  123. Which of the following statement is false?

    1. Arrays are dense lists and static data structure
    2. data elements in linked list need not be stored in adjecent space in memory
    3. pointers store the next data element of a list
    4. linked lists are collection of the nodes that contain information part and next pointer
  124. The expression DE+H* is called ________.

    1. Prefix expression
    2. Infixexepression
    3. Postfix expression
    4. Hybrid expression
  125. An efficient program executes faster and helps in ________ the usage of resources like memory and disk.

    1. Maximizing
    2. Minimizing
    3. Equalizing
    4. None of the given
  126. Which operation of queue data structure is used to get front element from the queue and then remove it from the queue?

    1. enqueue()
    2. dequeue()
    3. front()
    4. remove()
  127. In singly linked list a node consists of two parts:

    1. Object and structure
    2. Two pointers
    3. Two objects
    4. Object and pointer
  128. The tree data structure is a

    1. Linear data structure
    2. Non-linear data structure
    3. Graphical data structure
    4. Data structure like queue
  129. For Binary Search Tree, we call the findMax() method as ________.

    1. findMin(tree->getLeft())
    2. findMin(tree->getRight())
    3. findMin(tree->getCenter())
    4. findMin(tree->getDown())
  130. In a tree, we link the nodes in such a way that it ________ a linear structure.

    1. does not remain
    2. forms
    3. reverses
    4. remains
  131. Doubly Linked List always has ________ NULL pointer/s in a node.

    1. One
    2. Two
    3. Three
    4. Four
  132. From Operating System point of view, the recursive function calls are made with the help of ________.

    1. Queue
    2. Stack
    3. Linked list
    4. Binary Search Tree
  133. The most difficult case for deleting a node from Binary Search Tree is when the node to be deleted ________.

    1. is Leaf node
    2. has only left children (subtree)
    3. has only right children (subtree)
    4. has both the left and right children (subtree)
  134. In simple or singly linked list there is/are ________ pointer/s in each node.

    1. One
    2. Two
    3. Three
    4. Four
  135. The tree structure is a

    1. Linear data structure
    2. Non-linear data structure
    3. Graphical data structure
    4. data structure like queue
  136. Consider we have performed the following operations on stack of size 5.
    Push(10);
    Push(20);
    Push(30);
    Pop();
    Pop();
    Push(40);

    1. 10
    2. 20
    3. 40
    4. 20
  137. Consider the following infix expression.
    7/8 + 9
    If one converts the above expression into postfix. What would be the resultant expression?

    1. 7 8 9 / +
    2. 7 8 / + 9
    3. / 7 8 + 9
    4. 7 8 / 9 +
  138. AVL tree is linear data structure.

    1. TRUE
    2. FALSE
    3. In some cases
    4. None of the given
  139. When we compare recursive method calls and non-recursive method calls, following statement is true.

    1. Recursion is implementted in the same way as other functioncalls are implemented
    2. Non-recursive methods are always efficient than recursive methods
    3. Both options are true
    4. None of the given options are true
  140. In C++, we place the class interface in ________ file.

    1. .cpp
    2. .cppp
    3. .h
    4. .hh
  141. ~BinarySearchTree() is a ________ .

    1. Constructor
    2. Destructor
    3. Switch case
    4. Template method call
  142. In level-order traversal for Binary Search Tree, at each level, we visit the nodes in ________ order.

    1. right-to-left
    2. left-to-right
    3. top to botton
    4. any
  143. next() method of List class is used to:

    1. Moves current position backward one element
    2. Moves the "current" pointer to two steps after the last elementof the array
    3. Moves the current position forward one element
    4. Moves the "current" pointer to two steps before the last element of the array
  144. Binary Search Tree voilates the condition of AVL tree when any node has balance equal to

    1. 2 or -2
    2. 1 or -1
    3. 0
    4. None of the options.
  145. In singly linked list which node will keep track of starting position of the list.

    1. Next Node
    2. Previous Node
    3. Head Node
    4. Last Node
  146. Local variables defined inside function body are ________ automatically at the end of function execution.

    1. created
    2. destroyed
    3. incremented
    4. decremented
  147. Can we store elements with different data types in a single array?

    1. Yes
    2. No
    3. In some cases
    4. None of the given
  148. Trying to remove an element from an empty stack is called ________ .

    1. Garbage collector
    2. Overflow of stack
    3. Empty collection
    4. Underflow of stack
  149. ________ is an area in computer memory that is allocated dynamically.

    1. Heap
    2. Stack
    3. Queue
    4. Linked List
  150. ________ is when function is calling to itself.

    1. Loop
    2. Recursion
    3. Iteration
    4. Nasted loop
  151. "new int[11]" will allocate memory for ________ integers.

    1. 10
    2. 11
    3. 12
    4. 13
  152. int htdiff = height(root->getLeft()) ________ height(root->getRight());
    The above line of code is taken from AVL insert method. Complete it by selecting an appropriate symbol.

    1. -
    2. +
    3. /
    4. *
  153. Longest path from root node to farthest leaf node is called ________ of tree.

    1. Level
    2. Length
    3. Depth
    4. Node level
  154. The depth of a binary tree is

    1. Total number of nodes in the tree
    2. Number of leaf nodes in the tree
    3. Number of non-leaf nodes in the tree
    4. Maximum level of a leaf
  155. Array cells are ________ in computer memory.

    1. Contiguous
    2. Random
    3. Store in multiple variables
    4. Store in multiple functions
  156. Which of the following operation returns but do not removes top value of the stack?

    1. push
    2. pop
    3. top
    4. first
  157. In case of insertion of right inner node in BST,

    1. we need to apply single left rotation to make it AVL tree.
    2. we need to apply single right rotation to make it AVL tree.
    3. single left rotation first and then single right rotation to make it AVL tree.
    4. single right rotation first and then single left rotation to make it AVL tree.
  158. get(?) method of list class is used to:

    1. Get element from the last position
    2. Get element from the first position
    3. Get element from the middle position
    4. Get element at the given position
  159. ________ is used for Reference variables in C++.

    1. !
    2. @
    3. #
    4. &
  160. Y = &x[0];
    In the above statement, we get address of the first location of the array x and store
    it in y. Here "y" is:

    1. rvalue
    2. xvalue
    3. lvalue
    4. zvalue
  161. Suppose we have been given the following data set for a Queue.
    7 5 2 4
    What will be the resultant Queue if we call enqueue(3) method?
    Note that 7 is the front element whereas 4 is rear element of queue.

    1. 7 5 2 4
    2. 3 7 5 2 4
    3. 7 5 2 4 3
    4. 5 2 4 3
  162. In tree, the search operation is ________ as compared to the linked list.

    1. Very fast
    2. not fast
    3. equally time-taken
    4. very slow
  163. To search an element in ALV tree, it takes maximum 1.88 Log2n time.

    1. TRUE
    2. FALSE
    3. In some cases
    4. None of the given
  164. ________ in AVL is logarithmic.

    1. Updating
    2. Searching
    3. Deletion
    4. Insertion
  165. The ________ of a node in a binary tree is defined as the height of its left subtree minus height of its right subtree.

    1. Height
    2. Balance
    3. Width
    4. None of the above
  166. Which of the following is not a form of exoression?

    1. Infix
    2. Postfix
    3. Prefix
    4. Pastfix
  167. What will be postfix expression of the following infix expression?
    Infix Expression: a+b*c-d

    1. ab+c*d-
    2. abc*+d-
    3. abcd+*-
    4. abc+*d-
  168. What will be the postfix expression of following infix expression?
    D+E*F/G

    1. DE*F/G+
    2. DE+F*G/
    3. DEF*G/+
    4. DE+FG*/
  169. Factorial is an example of ________ function.

    1. Recusive
    2. Non-Recursive
    3. Cube
    4. Log
  170. which of the following function don't belongs to the stack class?

    1. push()
    2. pop()
    3. crash()
    4. top()
  171. What will be the result of evaluation following expression?
    5+3*2/(6-3)

    1. 3
    2. 5
    3. 7
    4. 10
  172. Which of the following is correct statement?

    1. An AVL tree is identical to BST expect height of the left and right subtree can differ by at most 1.
    2. An AVL tree is identical to BST expect height of the left and right subtree can differ by at least 1.
    3. An AVL tree is identical to BST expect height of the left and right subtree must differ by at least 1.
    4. An AVL tree is not identical to BST, its another kind of tree.
  173. If we use array to implement list, then there is an issue that it gives difficulty when:

    1. We will access values randomly
    2. We will remove data from it
    3. We will increase its size
    4. We will decrease its size
  174. Which of the following can be used to reverse a string value?

    1. Stack
    2. Queue
    3. Both of these
    4. None of the given
  175. Binary search algorithem cannot be applied to ________ .

    1. sortrd linked list
    2. sorted binary trees
    3. sorted linear array
    4. None of the given
  176. Consider the linked list having data [6, 72, 35, 65, 25] stored in it. While current pointer is pointing to memory location having 72 stored in it. After calling add(4) function on the following linked list current point will point to memory location having value?

    1. 72
    2. 35
    3. 4
    4. 25
  177. for every process executing, the last part of the memory is for ________ of the program.

    1. Data
    2. Code
    3. Stack
    4. Heap
  178. Following is a keyword of C++ ________ .

    1. del
    2. delete
    3. Remove
    4. eliminate
  179. In doubly linked list there is/are _______ pointer/s in each node.

    1. One
    2. Two
    3. Three
    4. Four
  180. Avl tree takes maximum ________ time to search an element.

    1. 1.44 Log2n
    2. Log2(n+n)
    3. Log2(n+1)+1
    4. 1.88 Log2n
  181. There are four cases of rotation is an ________ tree.

    1. ELV
    2. EVL
    3. AVL
    4. ALV
  182. Allocating and de-allocating memory for linked list nodes take ________ time than pre-allocated array.

    1. Less
    2. More
    3. Equal
    4. No
  183. The binary tree is the maximum level of its leaves (also called the depth).

    1. Level
    2. Width
    3. Height
    4. None of the given
  184. If we singly linked list to implement list, then there is an issue that it gives difficulty when we:

    1. Move forward in the list
    2. Move backward in the list
    3. We will increase its size
    4. We will decrease its size
  185. back() method of list class is used to:

    1. Moves the "current" pointer to backward one element.
    2. Moves the "current" pointer to backward two element.
    3. Moves the "current" pointer to backward three element.
    4. Moves the "current" pointer to backward four element.
  186. While implementing non-recusive traversal for Binary SearchTree, we need to implement ________ .

    1. Queue
    2. Stack
    3. Min heap
    4. Max heap
  187. In which of the following function signatures, the value of variable "num" cannot be changed in function body?

    1. int cube(int num)
    2. int cube(int& num)
    3. int cube(const int& num)
    4. int cube(int* num)
  188. What are the basic things associated with data structures?

    1. Space for each data item it stores
    2. Time to perform each basic operation
    3. Programming effort
    4. All of the given
  189. Every AVL tree is a binary search tree.

    1. TRUE
    2. FALSE
    3. Not in some cases
    4. None of the given
  190. When an executable program runs, it is loaded in the computer memory and becomes a ________ .

    1. Thread
    2. .h file
    3. Process
    4. None of the given
  191. Left, right, info, and parent are the operation of ________ data structure.

    1. Stack
    2. Tree
    3. Queue
    4. Linked List
  192. Binary Tree traversal can be performed with the help of ________ .

    1. Recursive calls only
    2. Non-recursive calls
    3. Both Recursive and Non-recursive calls
    4. None of the given
  193. Here is a small function definition:
    void f(int i, int &k)
    {
    i = 1;
    k = 2;
    }

    Suppose that a main program has two integer variables x and y, which are given the value 0. Then the main program calls f(x,y); What are the values of x and y after the function f finishes?

    1. Both x and y are still 0.
    2. x is now 1, but y is still 0.
    3. x is still 0, but y is now 2.
    4. x is now 1, and y is now 2.
  194. Select the one FALSE statement about binary trees:

    1. Every binary tree has at least one node.
    2. Every non-empty tree has exactly one root node.
    3. Every node has at most two children.
    4. Every non-root node has exactly one parent.