A) binary search tree (BST) B) Red-Black tree C) B-tree D) AVL tree
A) The number of nodes on the path from the root to that node B) The number of levels in the tree C) The height of the node D) The value of the node
A) B-tree B) Red-Black tree C) AVL tree D) Binary search tree (BST)
A) Preorder B) Inorder C) Level order D) Postorder
A) Internal node B) Sibling node C) Leaf node D) Root node
A) The maximum number of children of any node B) The number of edges from the root to the deepest leaf C) The height of the tree D) The total number of nodes
A) 0 B) 1 C) 3 D) 2
A) Binary search tree B) B-tree C) AVL tree D) Trie
A) AVL tree B) Trie C) Binary tree D) B-tree
A) Inorder B) Preorder C) Level order D) Postorder
A) The number of nodes in the tree B) The distance from the root to the deepest leaf C) The number of leaves in the tree D) The maximum number of children a node can have
A) Level order B) Preorder C) Postorder D) Inorder
A) Leaf node B) Sibling node C) Internal node D) Unary node
A) A linear data structure B) A graph C) A hash table D) A hierarchical data structure
A) It must be a right child. B) It could be either a left or a right child. C) It must be a left child. D) It cannot have only one child.
A) To store data in a random order B) To ensure the tree is balanced C) To store data in a sorted order D) To minimize the height of the tree
A) Sibling node B) Internal node C) Leaf node D) Unary node
A) Linear in the number of nodes B) Constant C) Quadratic in the number of nodes D) Logarithmic in the number of nodes
A) A set of all nodes in the graph B) A cycle without any vertices C) A route connecting two nodes D) A collection of edges
A) It has multiple components B) There are no edges C) All vertices are reachable from one another D) It is a directed graph only
A) A linear data structure B) A collection of nodes and edges C) A collection of arrays D) A type of tree
A) Dijkstra's algorithm B) Kruskal's algorithm C) Depth-first search D) Prim's algorithm
A) Vertices that form a cycle B) A single set of vertices C) Only one vertex D) Two sets of vertices where edges only connect nodes from different sets
A) The number of paths from that vertex B) The number of edges connected to it C) The total number of vertices in the graph D) The distance to the farthest vertex
A) The distance between two vertices B) A connection between two vertices C) The total number of edges D) The number of vertices in a graph
A) The edge can be traversed in both ways B) The edge can only be traversed in one way C) The edge connects two nodes of different types D) The edge does not exist
A) 1 or more B) Exactly 2 C) Infinite D) 0 or 1
A) A graph with no edges B) A graph where edges have values associated with them C) A graph where vertices have weights D) A graph where all edges have the same weight
A) To represent node and edge connectivity in a graph. B) To simplify graph traversal. C) To perform sorting operations. D) To store edge weights only.
A) A graph that can be divided into two or more subgraphs B) A graph with no edges C) A graph where all vertices are connected by edges D) A graph that contains cycles
A) It contains at least one cycle. B) It allows weighted edges. C) It is always directed. D) It has no parallel edges or self-loops.
A) A path that visits every vertex B) A disconnected graph C) A graph with no edges D) A closed path where the starting and ending vertices are the same
A) Adjacency matrix B) Linked list C) Stack D) Array only
A) Undirected Graph B) Bipartite Graph C) Directed Graph D) Complete Graph
A) Directed Graph B) Bipartite Graph C) Complete Graph D) Weighted Graph
A) A hierarchical data structure B) A linear data structure C) A data type in C++ D) A non-linear data structure
A) The item in the middle B) The first item added C) The last item added D) The item at random
A) Pop B) Enqueue C) Dequeue D) Push
A) Dequeue B) Pop C) Push D) Enqueue
A) stack B) queue C) tree D) linked list
A) Insertion at one end and deletion at the other end B) Only insertion C) Only deletion D) Insertion and deletion at both ends
A) Elements are discarded B) Elements are added at the beginning of the queue C) Elements are added at the end of the queue D) An error is generated
A) Deque B) Banana queue C) Circular Queue D) Priority Queue
A) O(1) for both enqueue and dequeue B) O(n) for both enqueue and dequeue C) O(n) for enqueue and O(1) for dequeue D) O(n) for both enqueue and dequeue
A) Using stacks B) Using arrays C) Using linked lists D) Using dynamic arrays
A) A queue that gives priority to older elements B) A queue that processes elements in a random order C) A queue in which elements are processed based on their priority D) A queue with a fixed size
A) Stack B) Binary heap C) Queue D) Circular queue
A) A deque can only dequeue elements from the front. B) A deque can only enqueue elements at the front. C) A deque can enqueue and dequeue elements at both ends. D) A regular queue is faster than a deque.
A) The element with the highest priority B) The element added most recently C) The element added least recently D) The element with the lowest priority
A) Priority Queue B) deque C) Circular Queue D) Normal Queue
A) Stack B) Priority Queue C) Deque D) Circular Queue
A) n-m B) m C) n D) 0
A) The last element added is processed first. B) The first element added is processed first. C) The order is implementation-specific. D) They are processed in a random order.
A) Breadth-first search (BFS) B) Undo functionality in text editors C) Sorting algorithms D) Print spooling
A) None of the above B) Enqueue C) Both enqueue and dequeue D) Dequeue
A) dequeue() B) front() C) pop_front() D) remove_front()
A) Better memory utilization B) Simpler implementation C) Faster enqueue operation D) No advantage; they are equivalent
A) Circular Queue B) Priority Queue C) Cache D) Deque
A) Stack B) Circular Queue C) Priority Queue D) Deque
A) It is not suitable for implementing a priority queue. B) It may lead to wasted memory for a large maximum size. C) It has faster enqueue and dequeue operations. D) It allows for dynamic sizing.
A) The first element added B) The element with the highest value C) The element with the lowest value D) The last element added
A) Normal Queue B) Deque C) Circular Queue D) Priority Queue
A) heap data structure B) Stack C) Linked List D) Binary Tree
A) pop_back() B) back() C) dequeue() D) remove_back()
A) Age-Ordered Queue B) Priority Queue C) Circular Queue D) Normal Queue
A) Circular queues cannot be full. B) Compare the rear and front pointers modulo the queue size. C) Check if the rear pointer is ahead of the front pointer by 1. D) Check if the front pointer is ahead of the rear pointer by 1.
A) The element with the higher value is removed. B) The element with the lower value is removed. C) The element added first is removed. D) It's implementation-dependent.
A) Unambiguous B) Input C) Dependent D) Feasibility E) Output
A) Space Complexity B) Abstraction C) Efficiency D) Time complexity E) Reusability
A) Reusability B) Abstraction C) Space Complexity D) Efficiency E) Time complexity
A) Time complexity B) Reusability C) Abstraction D) Efficiency
A) Homogeneous or non-homogeneous B) Linear or non-linear C) Static or dynamic
A) Homogeneous or non-homogeneous B) Static or dynamic C) Linear or non-linear
A) Homogeneous or non-homogeneous B) Static or dynamic C) Linear or non-linear
A) Content B) User C) Context D) Data classification |