1. How many children does a binary tree have?
A . 2
B . any number of children
C . 0 or 1 or 2
D . 0 or 1
2. To represent hierarchical relationship between elements, Which data structure is suitable?
A . Queue
B . Stack
C . Tree
D . Graph
3. What is/are the disadvantages of implementing tree using normal arrays?
A . difficulty in knowing children nodes of a node
B . difficult in finding the parent of a node
C . have to know the maximum number of nodes possible before creation of trees
D . difficult to implement
4. Advantages of linked list representation of binary trees over arrays?
A . dynamic size
B . ease of insertion/deletion
C . ease in randomly accessing a node
D . both dynamic size and ease in insertion/deletion
5. Disadvantages of linked list representation of binary trees over arrays?
A . Randomly accessing is not possible
B . Extra memory for a pointer is needed with every element in the list
C . Difficulty in deletion
D . Random access is not possible and extra memory with every element
6. If binary trees are represented in arrays, what formula can be used to locate a left child, if the parent node has an index i?
A . 2i+1
B . 2i+2
C . i+1
D . i+2
7. Using what formula can a parent node be located in an array?
A . (i+1)/2
B . (i-1)/2
C . i/2
D . 2i/2
8. Which of the following properties are obeyed by all three tree – traversals?
A . Left subtrees are visited before right subtrees
B . Right subtrees are visited before left subtrees
C . Root node is visited before left subtree
D . Root node is visited before right subtree
9. A binary search tree contains values 7, 8, 13, 26, 35, 40, 70, 75. Which one of the following is a valid post-order sequence of the tree provided the pre-order sequence as 35, 13, 7, 8, 26, 70, 40 and 75?
A . 7, 8, 26, 13, 75, 40, 70, 35
B . 26, 13, 7, 8, 70, 75, 40, 35
C . 7, 8, 13, 26, 35, 40, 70, 75
D . 8, 7, 26, 13, 40, 75, 70, 35
10. In a binary search tree, which of the following traversals would print the numbers in the ascending order?
A . Level-order traversal
B . Pre-order traversal
C . Post-order traversal
D . In-order traversal
11. The number of edges from the root to the node is called __________ of the tree.
A . Height
B . Depth
C . Length
D . Width
12. The number of edges from the node to the deepest leaf is called _________ of the tree.
A . Height
B . Depth
C . Length
D . Width
13. What is a full binary tree?
A . Each node has exactly zero or two children
B . Each node has exactly two children
C . All the leaves are at the same level
D . Each node has exactly one or two children
14. What is a complete binary tree?
A . Each node has exactly zero or two children
B . A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left
C . A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right
D . A tree In which all nodes have degree 2
15. Which of the following is false about a binary search tree?
A . The left child is always lesser than its parent
B . The right child is always greater than its parent
C . The left and right sub-trees should also be binary search trees
D . In order sequence gives decreasing order of elements
16. What is the main characteristic of a B Tree?
A . Each node has a variable number of children within a specified range.
B . Nodes are arranged in a binary structure.
C . Tree height is logarithmic in the number of elements.
D . All nodes store the same number of keys.
17. In a B Tree, what property does the order `m` define?
A . Maximum number of children a node can have.
B . Maximum height of the tree.
C . Maximum number of keys a node can have.
D . Maximum number of nodes in the tree.
18. Which of the following operations can be performed efficiently using a B Tree?
A . Multiplication of sparse matrices
B . Insertion, deletion, and search of keys in a database
C . Finding the shortest path in a graph
D . Balancing a binary search tree
19. What is a significant advantage of using B Trees in database systems?
A . They require less memory than binary search trees.
B . They ensure minimal disk I/O operations.
C . They do not require balancing.
D . They can store any type of data without conversion.
20. How do B+ Trees differ from B Trees?
A . B+ Trees are binary trees, while B Trees are multi-way trees.
B . In B+ Trees, all keys are stored in leaf nodes and internal nodes act as routing guides.
C . B+ Trees do not allow duplicates, while B Trees do.
D . B+ Trees have a fixed height, while B Trees have variable height.
21. What is the advantage of B+ Trees over B Trees in terms of range queries?
A . B+ Trees require fewer comparisons for range queries.
B . B+ Trees provide faster access to individual keys.
C . Leaf nodes of B+ Trees are linked, providing efficient full-range scans.
D . B+ Trees have a simpler structure, making range queries more straightforward.
22. In a B+ Tree, where are the actual records pointed to by the keys stored?
A . In every node
B . Only in root nodes
C . Only in internal nodes
D . Only in leaf nodes
23. Why are B+ Trees preferred in database indexing over B Trees?
A . B+ Trees provide faster insertion and deletion operations.
B . The linked leaf nodes in B+ Trees make sequential access faster.
C . B+ Trees require less disk space.
D . B+ Trees are easier to implement.
24. What is the key property of an AVL Tree?
A . Every node has at most two children.
B . The tree is a complete binary tree.
C . The difference in height between the left and right subtrees of any node is at most 1.
D . All leaf nodes are at the same level.
25. What is the time complexity of insertion in an AVL Tree?
A . O(1)
B . O(log n)
C . O(n)
D . O(n log n)
26. Which of the following operations can cause an AVL Tree to become unbalanced?
A . Searching for a node
B . Inserting a node
C . Traversing the tree
D . Computing the height of the tree
27. What mechanism is used to maintain the balance of an AVL Tree after insertion or deletion?
A . Red-Black balancing
B . Splay operation
C . Tree rotations
D . B-tree splitting
28. In the context of AVL Trees, what is a rotation?
A . Swapping the values of two nodes
B . Moving a subtree to a different location in the tree
C . Changing the structure of the tree without altering the in-order sequence of elements
D . Changing the root of the tree
29. What is the maximum number of rotations needed to balance an AVL Tree after a single insertion?
A . 1
B . 2
C . 3
D . 4
30. How does the height of an AVL Tree compare to the height of a perfectly balanced binary tree?
A . It is always the same.
B . It can be up to twice as large.
C . It can be larger, but no more than log n.
D . It can be smaller, but no less than log n.
31. Which of the following is true about the deletion operation in an AVL Tree?
A . It cannot cause the tree to become unbalanced.
B . It may require rebalancing through rotations.
C . It is always performed without rotations.
D . It is less complex than deletion in a binary search tree.
32. What is a distinctive feature of a Red-Black Tree?
A . Each node is colored either red or black.
B . Each node can have up to three children.
C . The tree is always perfectly balanced.
D . All leaf nodes are at the same depth.
33. Which of these properties must a Red-Black Tree satisfy?
A . Every red node must have two black child nodes.
B . Every path from a node to its descendant NIL nodes has the same number of black nodes.
C . All leaf nodes are black.
D . All of the above.
34. What is the time complexity of insertion and deletion operations in a Red-Black Tree?
A . O(1)
B . O(log n)
C . O(n)
D . O(n log n)
35. What action is performed to maintain the Red-Black properties after an insertion or deletion?
A . Splitting the tree
B . Recoloring nodes and performing rotations
C . Swapping sibling nodes
D . Converting the tree to a binary search tree and then back to a red-black tree
36. In a Red-Black Tree, what does the property "the tree has the same number of black nodes on any path from a node to a descendant leaf" ensure?
A . The tree is perfectly balanced.
B . The tree is height-balanced, with the longest path no more than twice the length of the shortest path.
C . All paths have the same length.
D . The tree is a full binary tree.
37. Which of the following operations may cause a violation of Red-Black Tree properties?
A . Searching for a node
B . Inserting a node
C . Traversing the tree
D . Computing the height of the tree
38. What is the maximum height of a Red-Black Tree with `n` nodes?
A . 2log2(n+1)2log2(n+1)
B . log2nlog2n
C . nn
D . 2n2n
39. Why are Red-Black Trees important in computer science?
A . They provide a worst-case guarantee for insertion, deletion, and search operations.
B . They are easier to implement than binary search trees.
C . They require less memory than AVL trees.
D . They do not require rebalancing after every insertion or deletion.
40. What is a Splay Tree?
A . A tree where recently accessed elements are quick to access again.
B . A perfectly balanced binary search tree.
C . A binary tree with unique height properties.
D . A tree where each node has exactly two children.
41. What is the key operation used in Splay Trees to maintain tree properties?
A . Splitting
B . Coloring
C . Splaying
D . Rotating
42. What does the splaying operation in a Splay Tree do?
A . Moves a node to the root through a series of rotations.
B . Swaps two child nodes.
C . Ensures all leaf nodes are at the same depth.
D . Balances the tree perfectly after every operation.
43. What is the time complexity of search, insert, and delete operations in a Splay Tree in the amortized case?
A . O(1)
B . O(log n)
C . O(n)
D . O(n log n)
44. Which of the following scenarios best demonstrates the advantage of a Splay Tree?
A . When the tree is accessed randomly and there are no frequently accessed nodes.
B . When certain nodes are accessed frequently and need to be accessed quickly.
C . When the tree is used for one-time write and read operations.
D . When the tree requires frequent rebalancing to maintain strict height balance.
45. What property does a Splay Tree use to ensure that recently accessed elements are quick to access again?
A . The tree rebalances itself after every operation.
B . Nodes are colored red or black to indicate their access frequency.
C . Frequently accessed nodes are moved closer to the root.
D . Leaf nodes are linked together for faster sequential access.
46. In a Splay Tree, what happens after an element is accessed (searched, inserted, or delete?
A . The tree is left unchanged.
B . The accessed element is moved to the root of the tree.
C . The tree is completely rebuilt.
D . The accessed element is moved to a leaf position.
47. Why might Splay Trees not be suitable in an environment with parallel or concurrent operations?
A . Because the structure of the tree changes frequently, making it hard to predict.
B . Because they are more memory-intensive than other trees.
C . Because splay operations are not thread-safe.
D . Because they do not support concurrent modifications well due to the restructuring after operations.
☞ Data Structures Objective Type Question Bank-Unit-1 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-2 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-3 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-4 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-5 - [ DS ]
☞ R - Programming MCQs - Unit-1 - [ R-Programming ]
☞ R - Programming MCQs - Unit-2 - [ R-Programming ]
☞ R - Programming MCQs - Unit-3 - [ R-Programming ]
☞ R - Programming MCQs - Unit-4 - [ R-Programming ]
☞ R - Programming MCQs - Unit-5 - [ R-Programming ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]
☞ PPS MCQs - Unit-1 - [ PPS ]
☞ PPS MCQs - Unit-2 - [ PPS ]
☞ PPS MCQs - Unit-3 - [ PPS ]
☞ PPS MCQs - Unit-4 - [ PPS ]
☞ PPS MCQs - Unit-5 - [ PPS ]
☞ Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]
☞ Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]
☞ Software Engineering MCQs - Unit-1 - [ SE ]
☞ Software Engineering MCQs - Unit-2 - [ SE ]
☞ Software Engineering MCQs - Unit-3 - [ SE ]
☞ Software Engineering MCQs - Unit-4 - [ SE ]
☞ Software Engineering MCQs - Unit-5 - [ SE ]
☞ Data Mining MCQs - Unit-1 - [ DM ]
☞ Data Mining MCQs - Unit-2 - [ DM ]
☞ Data Mining MCQs - Unit-3 - [ DM ]
☞ Data Mining MCQs - Unit-4 - [ DM ]
☞ Data Mining MCQs - Unit-5 - [ DM ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]
☞ Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]
☞ Cyber Forensics Objective Type Question Bank-Part-2 - [ Cyber Forensics ]
☞ Cyber Forensics Objective Type Question Bank-Part-1 - [ Cyber Forensics ]
☞ Java Programming Objective Type Question Bank - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-1 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-2 - [ Java Programming ]