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