MID-TERM GRAND QUIZ
FALL 2020 (Paper 2)
Question No 1:
The worst case (Raise For Success) of building a heap of N keys is ________
- N
- N^2
- NlogN Correct
- 2^N
Question No 2:When a complete binary tree represented by an array (Raise For Success) then if right child is at position 5 then left child will be at position ______- 2
- 3
- 4 Correct
- 6
- 2
- 3
- 4 Correct
- 6
Question No 3:Which of the (Raise For Success) following statement is true about dummy node of threaded binary tree?- The left pointer of dummy node points to the itself while the right pointer points to the root of the tree
- The left pointer of dummy node points to the root node of the tree while the right pointer points itself i.e to dummy node Correct
- The left pointer of dummy node points to the root node of the tree while the right pointer is always NULL
- The right pointer of dummy node points to the itself while the left pointer is always NULL
- The left pointer of dummy node points to the itself while the right pointer points to the root of the tree
- The left pointer of dummy node points to the root node of the tree while the right pointer points itself i.e to dummy node Correct
- The left pointer of dummy node points to the root node of the tree while the right pointer is always NULL
- The right pointer of dummy node points to the itself while the left pointer is always NULL
Question No 4:In which of the following tree, parent node has key greater than or (Raise For Success) equal to its both children?- Max heap
- Binary search tree
- Threaded Binary tree
- Complete Binary tree Correct
- Max heap
- Binary search tree
- Threaded Binary tree
- Complete Binary tree Correct
Question No 5:Which one of the (Raise For Success) following traversals give the mathematical expression of an expression tree:- inorder Correct
- preorder
- levelorder
- postorder
- inorder Correct
- preorder
- levelorder
- postorder
Question No 6:Traversing a binary (Raise For Success) tree can only be done using ______- Iteration
- Recursion
- Both recursion and iteration Correct
- None of the given options
- Iteration
- Recursion
- Both recursion and iteration Correct
- None of the given options
Question No 7:If both pointers of (Raise For Success) the node in a binary tree are NULL then it will be a/an:- Inner node
- Leaf node Correct
- Root node
- None of the given options
- Inner node
- Leaf node Correct
- Root node
- None of the given options
Question No 8:A Threaded Binary Tree is a binary tree in which every node that (Raise For Success) does not have a right child has a THREAD (in actual sense, a link) to its ______ successor.- Preorder Correct
- Inorder
- Postorder
- levelorder
- Preorder Correct
- Inorder
- Postorder
- levelorder
Question No 9:A complete binary (Raise For Success) tree of height 3 has between ______ nodes.- 8 to 14
- 8 to 15
- 8 to 16 Correct
- 8 to 17
- 8 to 14
- 8 to 15
- 8 to 16 Correct
- 8 to 17
Question No 10:In complete binary (Raise For Success) tree the bottom level is filled from _______.- Left to right Correct
- Right to left
- Not filled at all
- None of the given options
- Left to right Correct
- Right to left
- Not filled at all
- None of the given options
Question No 11:Which data structure (Raise For Success) is needed to convert infix expression to postfix expression?- Graph
- Tree
- Queue
- Stack Correct
- Graph
- Tree
- Queue
- Stack Correct
Question No 12:In time-based (Raise For Success) simulation, we maintain a/an _________- variable
- event
- clock Correct
- register
- variable
- event
- clock Correct
- register
Question No 13:In ________ a programmer, (Raise For Success) uses two pointers in the node, i.e. one to point to next node and the other to point to the previous node.- Linked list
- doubly-link list Correct
- array
- structure
- Linked list
- doubly-link list Correct
- array
- structure
Question No 14:If there is a (Raise For Success) strictly complete binary tree of depth 3, the total number of nodes in it will be?- 15 Correct
- 16
- 8
- 7
- 15 Correct
- 16
- 8
- 7
Question No 15:start() method of (Raise For Success) List class is used to:- Moves the "current" pointer to very first element. Correct
- Moves the "current" pointer to very last element.
- Moves the "current" pointer to one step after the first element of the array.
- Moves the "current" pointer to one step before the first element of the array.
- Moves the "current" pointer to very first element. Correct
- Moves the "current" pointer to very last element.
- Moves the "current" pointer to one step after the first element of the array.
- Moves the "current" pointer to one step before the first element of the array.
Question No 16:get(?) method (Raise For Success) of List class is used to:- Get element from the last position
- Get element from the first position
- Get element from the middle position
- Get element at the given position Correct
Question No 17:We can make a (Raise For Success) lexicographic order of characters based on their ________.- Memory addresses
- ASCII values Correct
- Binary digits
- Random choice
Question No 18:At the time while (Raise For Success) evaluating an expression, if we want to give higher precedence to lower precedence operator, we used ______.- Parenthesis Correct
- Comas
- Operands
- Dots
- Get element from the last position
- Get element from the first position
- Get element from the middle position
- Get element at the given position Correct
Question No 17:
We can make a (Raise For Success) lexicographic order of characters based on their ________.
- Memory addresses
- ASCII values Correct
- Binary digits
- Random choice
Question No 18:
At the time while (Raise For Success) evaluating an expression, if we want to give higher precedence to lower precedence operator, we used ______.
- Parenthesis Correct
- Comas
- Operands
- Dots
Question No 19:_________ is (Raise For Success) a self-balancing tree.- AVL Correct
- Binary Tree
- Binary Search Tree
- ALV
- AVL Correct
- Binary Tree
- Binary Search Tree
- ALV
Question No 20:A queue is (Raise For Success) a ______ structure, whereas a stack is a _______ data structure.- FIFO,LIFO Correct
- LIFO,FIFO
- both of these
- none of these
- FIFO,LIFO Correct
- LIFO,FIFO
- both of these
- none of these
Question No 21:The balance of (Raise For Success) a node in a binary tree is defined as the height of its _______ sub tree minus height of its right sub tree.- right
- left Correct
- upper
- lower
- right
- left Correct
- upper
- lower
Question No 22:There is no such (Raise For Success) node whose next field is NULL, which one of the given option supports the statement.- Array Correct
- Queue
- Circular link list
- Linked list
- Array Correct
- Queue
- Circular link list
- Linked list
Question No 23:Compiler uses (Raise For Success) which one of the following in Function calls.- Stack Correct
- Queue
- Binary Search Tree
- AVL Tree
- Stack Correct
- Queue
- Binary Search Tree
- AVL Tree
Question No 24:If you want to (Raise For Success) return first element of the list which one method will be used.- Get();
- Peek();
- Start(); Correct
- Set();
- Get();
- Peek();
- Start(); Correct
- Set();
Question No 25:Before using the (Raise For Success) push method of stack, the user must call the ________ method.- isEmpty();
- isFull(); Correct
- push();
- pop();
- isEmpty();
- isFull(); Correct
- push();
- pop();
Question No 26:_________ objects (Raise For Success) (objects accessed by pointers) are called anonymous objects.- private
- Nameless Correct
- Friend
- public
- private
- Nameless Correct
- Friend
- public
Question No 27:Trying to remove (Raise For Success) an element from an empty, stack is called _______.- Garbage collection
- Overflow of stack
- Empty collection
- Underflow of stack Correct
- Garbage collection
- Overflow of stack
- Empty collection
- Underflow of stack Correct
Question No 28:The _____ of every node should be (Raise For Success) 1,0 or -1 otherwise, it will not be an AVL Tree.- Balance Correct
- Length
- Size
- width
- Balance Correct
- Length
- Size
- width
Question No 29:Memory address (Raise For Success) is stored in:- Address operator
- Reference
- Pointer Correct
- Array
- Address operator
- Reference
- Pointer Correct
- Array
Question No 30:Which of the following (Raise For Success) is the limitation of the array?- Cannot store user define objects
- Cannot store more than 1000 elements
- Have to random access
- Fix size Correct
- Cannot store user define objects
- Cannot store more than 1000 elements
- Have to random access
- Fix size Correct
Question No 31: Two common models (Raise For Success) of simulation are _____ and _______.- Circuit-based simulation and Event-based simulation
- Circuit-based simulation and Time-based simulation
- Time-based simulation and Event-based simulation Correct
- None of the above
Question No 31:
Two common models (Raise For Success) of simulation are _____ and _______.
- Circuit-based simulation and Event-based simulation
- Circuit-based simulation and Time-based simulation
- Time-based simulation and Event-based simulation Correct
- None of the above
Question No 32:Which of the following (Raise For Success) is correct syntax to pass a const variable by reference to a function?- int movePiece(cons Piece& currentPiece) Correct
- int movePiece(Piece&: constcurrentPiece)
- int movePiece const (Piece const currentPiece)
- int movePiece(Piece const currentPiece)
- int movePiece(cons Piece& currentPiece) Correct
- int movePiece(Piece&: constcurrentPiece)
- int movePiece const (Piece const currentPiece)
- int movePiece(Piece const currentPiece)
Question No 33:Suppose we are building the AVL tree using nodes (Raise For Success) 31,22 and 9 then which type of rotation at root node will balance the tree?- Single left
- Single right Correct
- Double left-right
- Double right-left
- Single left
- Single right Correct
- Double left-right
- Double right-left
Question No 34:To search an element (Raise For Success) which method of the list searches the entire list from beginning to end?- end():
- find(): Correct
- updated():
- start():
- end():
- find(): Correct
- updated():
- start():
Question No 35:The first step (Raise For Success) to add a node in a linked list between the existing nodes is:- newNode->setNext():
- newNode->setNext(currentNode->getNext()): Correct
- newNode->getNext():
- currentNode->getNext():
- newNode->setNext():
- newNode->setNext(currentNode->getNext()): Correct
- newNode->getNext():
- currentNode->getNext():
Question No 36:Consider the following expressions:P=A*B+C-DIn the (Raise For Success) above expression "+" is a _____ operator.- Binary Correct
- Unary
- Logical
- Technical
- Binary Correct
- Unary
- Logical
- Technical
Question No 37:Level-order traversal (Raise For Success) for Binary Search Tree can be implemented ______.- Only through recursive method Correct
- Only through non-recursive method
- Through both recursive method call and non-recursive method call
- Through max-heap
- Only through recursive method Correct
- Only through non-recursive method
- Through both recursive method call and non-recursive method call
- Through max-heap
Question No 38:Which one is not (Raise For Success) the property of binary tree?- Every node in binary tree should have maximum two children.
- Only one node should have two parents.
- Sibling nodes should have same parent.
- None of the given. Correct
- Every node in binary tree should have maximum two children.
- Only one node should have two parents.
- Sibling nodes should have same parent.
- None of the given. Correct
Question No 39:Which operation (Raise For Success) of queue data structure is used to get front element from the queue and then remove it from the queue?- enqueue()
- dequeue Correct
- front()
- remove()
- enqueue()
- dequeue Correct
- front()
- remove()
Question No 40:In a tree, we link (Raise For Success) the nodes in such a way that it ________ a linear structure.- does not remain Correct
- forms
- reverses
- remains
- does not remain Correct
- forms
- reverses
- remains
Question No 41:For every process (Raise For Success) executing, the last part of the memory is for _______ of the program.- Data
- Code
- Stack
- Heap Correct
- Data
- Code
- Stack
- Heap Correct
Question No 42:A queue is a (Raise For Success) data structure where elements are- inserted at the font and removed from the back. Correct
- inserted and removed from the top.
- inserted at the back and removed from the font.
- inserted and removed from both ends.
- inserted at the font and removed from the back. Correct
- inserted and removed from the top.
- inserted at the back and removed from the font.
- inserted and removed from both ends.
Question No 43:To search an (Raise For Success) element in ALV tree, it takes maximum 1.88 Log2n time.- True
- False Correct
- In some cases
- Searching cannot be performed in ALV, tree
- True
- False Correct
- In some cases
- Searching cannot be performed in ALV, tree
Question No 44:In a complete (Raise For Success) binary tree the number of nodes at level 5 are15163132 Correct
Question No 45:When a function (Raise For Success) calling itself is called as __________.- Inline
- Recursion Correct
- Iteration
- Nested loop
- Inline
- Recursion Correct
- Iteration
- Nested loop
Question No 46:The function calls (Raise For Success) are made with the help of ________.- Stack Correct
- Heap
- Dynamic memory
- External memory
- Stack Correct
- Heap
- Dynamic memory
- External memory
Question No 47:In time based (Raise For Success) simulation, we maintain a/an _______- variable Correct
- event
- clock
- register
- variable Correct
- event
- clock
- register
Question No 48:Suppose we have (Raise For Success) a value for Queue: 2 1 4 6 3.Where front is at 2 and rear is at 3, after dequeue one element from that Queue, what will be the resultant Queue?- 2 1 4 6
- 2 1 4 6 3
- 1 4 6 3 Correct
- 2 1 6 3
- 2 1 4 6
- 2 1 4 6 3
- 1 4 6 3 Correct
- 2 1 6 3
Question No 49:void _________ (TreeNode* treeNode)( (Raise For Success)if( treeNode != Null )_________ (treeNode >getl.eft()):cout << *(treeNode->getinfo())<<"";_________ (treeNode->getRight());- Preorder Correct
- Postorder
- Inorder
- Levelorder
- Preorder Correct
- Postorder
- Inorder
- Levelorder
Question No 40:In-order traversal (Raise For Success) method traverses the data in- Non sorted order
- Random order
- Sorted order
- None of the given Correct
- Non sorted order
- Random order
- Sorted order
- None of the given Correct
Question No 51:Factorial is an (Raise For Success) example of ______ function.
- Recursive Correct
- Non-Recursive
- Cube
- Log
Question No 52:Suppose we have (Raise For Success) a value for Queue: 2 1 4 6 3. Where front is at 2 and rear is at 3, after inserting new element 8 into that Queue, what will be the resultant Queue?
- 2 1 4 8
- 2 1 4 6 3 8
- 8 1 4 6 3
- 8 2 1 4 6 3 Correct
Question No 53:What will be the (Raise For Success) postfix expression of following infix expression A*B/C+D-E?- A B/C * D + E-
- A B* C/D + E- Correct
- A B* C + D E/-
- A B + C D/+ E-
- A B/C * D + E-
- A B* C/D + E- Correct
- A B* C + D E/-
- A B + C D/+ E-
Question No 54:Sub-tree of binary (Raise For Success) search tree should be ________- Binary tree
- Binary search tree Correct
- Complete binary tree
- None of the given
- Binary tree
- Binary search tree Correct
- Complete binary tree
- None of the given
Question No 55:We can a lexicographic order (Raise For Success) order of characters based on their _______.- Memory addresses
- ASCII Values Correct
- Binary digits
- Random choice
- Memory addresses
- ASCII Values Correct
- Binary digits
- Random choice
Question No 56:In array list the (Raise For Success) worst case of removing an element is:- To remove an element from the end of the list Correct
- To remove an element from the middle of the list
- To remove an element from the start of the list
- We can not remove element from an array list
- To remove an element from the end of the list Correct
- To remove an element from the middle of the list
- To remove an element from the start of the list
- We can not remove element from an array list
Question No 57:In ____ various cells of memory (Raise For Success) are not located continuously.- Arrays
- Linked List Correct
- Circular Array
- List
- Arrays
- Linked List Correct
- Circular Array
- List
Question No 58:While implementing stock with an array (Raise For Success) and to achieve LIFO behavior, we used push and pop elements _______.- The start of the array
- The end of the array Correct
- The mid of the array
- At least one position before array starting index
- The start of the array
- The end of the array Correct
- The mid of the array
- At least one position before array starting index
Question No 59:next() method (Raise For Success) of List class is used to:- Moves the current position backward one element
- Moves the "current" pointer to two steps after the last element of the array
- Moves the current position forward one element Correct
- Moves the "current" pointer to two steps before the last element of the array
- Moves the current position backward one element
- Moves the "current" pointer to two steps after the last element of the array
- Moves the current position forward one element Correct
- Moves the "current" pointer to two steps before the last element of the array
Question No 60:The expression (Raise For Success) DE+H* is called ______.- Prefix Expression
- Infix Expression
- Postfix Expression Correct
- Hybrid Expression
- Prefix Expression
- Infix Expression
- Postfix Expression Correct
- Hybrid Expression
Tags:
cs301
cs301 midterm solved past papers by Raise For Success
cs301 solved grand quiz
data structures
Fall 2021
Fall 2022
Fall 2023
Fall 2024
Fall 2025
Midterm Past Papers
solved past papers vu