CS301 Question No: 1 ( M - 1 )
Which one of the following operations returns top value of the stack?
► Push
► Pop
► Top
► First
CS301 Question No: 2 ( M - 1 )
Compiler uses which one of the following in Function calls,
► Stack
► Queue
► Binary Search Tree
► AVL Tree
CS301 Question No: 3 ( M - 1 )
Every AVL is _________________
► Binary Tree
► Complete Binary Tree
► None of these
► Binary Search Tree
CS301 Question No: 4 ( M - 1 )
If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
► 54
► 55
► 56
► 57
CS301 Question No: 5 ( M - 1 )
If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
► 23
► 24
► 21
► 22
CS301 Question No: 7 ( M - 1 )
Binary Search is an algorithm of searching, used with the ______ data.
► Sorted
► Unsorted
► Heterogeneous
► Random
CS301 Question No: 8 ( M - 1 )
Which one of the following is NOT true regarding the skip list?
► Each list Si contains the special keys + infinity and - infinity.
► List S0 contains the keys of S in non-decreasing order.
► Each list is a subsequence of the previous one.
► List Sh contains only the n special keys.
CS301 Question No: 9 ( M - 1 )
A simple sorting algorithm like selection sort or bubble sort has a worst-case of
► O(1) time because all lists take the same amount of time to sort
► O(n) time because it has to perform n swaps to order the list.
► O(n2) time because sorting 1 element takes O(n) time - After 1 pass through the list,
either of these algorithms can guarantee that 1 element is sorted.
► O(n3) time, because the worst case has really random input which takes longer to
sort.
CS301 Question No: 10 ( M - 1 )
Which of the following is a property of binary tree?
► A binary tree of N external nodes has N internal node.
► A binary tree of N internal nodes has N+ 1 external node.
► A binary tree of N external nodes has N+ 1 internal node.
► A binary tree of N internal nodes has N- 1 external node.
CS301 Question No: 11 ( M - 1 )
By using __________we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
► Binary tree only
► Threaded binary tree
► Heap data structure
► Huffman encoding
CS301 Question No: 12 ( M - 1 )
Which of the following statement is true about dummy node of threaded binary tree?
► This dummy node never has a value.
► This dummy node has always some dummy value.
► This dummy node has either no value or some dummy value.
► This dummy node has always some integer value.
CS301 Question No: 13 ( M - 1 )
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
► N – (h – 1)
► N – (h + 1)
► N – 1
► N – 1 + h
CS301 Question No: 14 ( M - 1 ) - Please choose vu zs one
What is the best definition of a collision in a hash table?
► Two entries are identical except for their keys.
► Two entries with different data have the exact same key
► Two entries with different keys have the same exact hash value.
► Two entries with the exact same key have different hash values.
CS301 Question No: 15 ( M - 1 )
Which formula is the best approximation for the depth of a heap with n nodes?
► log (base 2) of n
► The number of digits in n (base 10), e.g., 145 has three digits
► The square root of n
► n
CS301 Question No: 16 ( M - 1 )
Which of the following statement is NOT correct about find operation:
► It is not a requirement that a find operation returns any specific name, just that finds on two elements return the same answer if and only if they are in the same set.
► One idea might be to use a tree to represent each set, since each element in a tree has the same root, thus the root can be used to name the set.
► Initially each set contains one element.
► Initially each set contains one element and it does not make sense to make a tree of one node only.
CS301 Question No: 17 ( M - 1 )
Which of the following is not true regarding the maze generation?
► Randomly remove walls until the entrance and exit cells are in the same set.
► Removing a wall is the same as doing a union operation.
► Remove a randomly chosen wall if the cells it separates are already in the same set.
► Do not remove a randomly chosen wall if the cells it separates are already in the same set.
CS301 Question No: 18 ( M - 1 )
In threaded binary tree the NULL pointers are replaced by ,
► preorder successor or predecessor
► inorder successor or predecessor
► postorder successor or predecessor
► NULL pointers are not replaced
CS301 Question No: 19 ( M - 1 )
Which of the given option is NOT a factor in Union by Size:
► Maintain sizes (number of nodes) of all trees, and during union.
► Make smaller tree, the subtree of the larger one.
► Make the larger tree, the subtree of the smaller one.
► Implementation: for each root node i, instead of setting parent[i] to -1, set it to -k if tree rooted at i has k nodes.
CS301 Question No: 20 ( M - 1 )
Suppose we had a hash table whose hash function is “n % 12”, if the number 35 is already in the hash table, which of the following numbers would cause a collision?
► 144
► 145
► 143
► 148
CS301 Question No: 21 ( M - 1 )
What requirement is placed on an array, so that binary search may be used to locate an entry?
► The array elements must form a heap.
► The array must have at least 2 entries.
► The array must be sorted.
► The array’s size must be a power of two.
CS301 Question No: 22 ( M - 1 )
A binary tree with 24 internal nodes has ______ external nodes.
► 22
► 23
► 48
► 25
CS301 Question No: 23 ( M - 1 )
In case of deleting a node from AVL tree, rotation could be prolong to the root node.
► Yes
► No
CS301 Question No: 24 ( M - 1 )
when we have declared the size of the array, it is not possible to increase or decrease it during the ________of the program.
► Declaration
► Execution
► Defining
► None of the above
CS301 Question No: 25 ( M - 1 )
it will be efficient to place stack elements at the start of the list because insertion and removal take _______time.
► Variable
► Constant
► Inconsistent
► None of the above
CS301 Question No: 26 ( M - 1 )
_______ is the stack characteristic but _______was implemented because of the size limitation of the array.
► isFull(),isEmpty()
► pop(), push()
► isEmpty() , isFull()
► push(),pop()