WorksheetsDSA Module-3 Quiz
Total questions: 10
Worksheet time: 5mins
What is a binary tree?
A binary tree is a type of graph with multiple edges.
A binary tree is a data structure where each node can have any number of children.
A binary tree is a data structure with no children.
A binary tree is a data structure where each node has at most two children.
List two properties of binary trees.
All nodes must have exactly two children.
The parent node is always the smallest value in the tree.
1. Each node has at most two children. 2. The left child is less than the parent node and the right child is greater in a binary search tree.
Each node can have any number of children.
Explain the linear representation of a binary tree.
A binary tree cannot be represented linearly in any form.
A binary tree can only be represented using a graph structure.
A binary tree can be represented linearly using an array or linked structure.
A binary tree is always represented as a circular linked list.
What is the main difference between linked representation and linear representation of a binary tree?
Linked representation uses a single array for all nodes.
Linked representation is faster for searching elements.
Linear representation allows dynamic resizing of the array.
The main difference is that linked representation uses nodes with pointers, while linear representation uses a fixed-size array.
Describe the insertion operation in a binary tree.
Insert a node by traversing the tree to find the correct empty position based on value comparisons.
Insert a node by randomly selecting a position in the tree.
Remove the smallest node and insert the new node in its place.
Always insert new nodes as the left child of the root node.
What is simple deletion in the context of binary trees?
Simple deletion refers to removing all leaf nodes from the tree.
Simple deletion involves adding a new node to the tree.
Simple deletion in binary trees is the process of removing a node while ensuring the tree remains valid.
Simple deletion is the process of balancing the tree after insertion.
Name the three common types of tree traversals.
Level-order, Depth-first, Breadth-first
Random-order, Circular-order, Spiral-order
Top-down, Bottom-up, Side-order
In-order, Pre-order, Post-order
What defines a binary search tree?
A binary search tree can have any number of children per node.
In a binary search tree, all values are equal to the node's value.
A binary search tree is a linear data structure with no hierarchical relationships.
A binary search tree is a tree data structure where each node has at most two children, and for each node, values in the left subtree are less than the node's value, and values in the right subtree are greater.
How is a graph represented using an adjacency matrix?
A graph is represented using an adjacency matrix as a collection of vertex labels.
A graph is represented using an adjacency matrix as a circular array of vertices.
A graph is represented using an adjacency matrix as a square matrix where each cell indicates the presence or absence of an edge between vertices.
A graph is represented using an adjacency matrix as a list of edges between vertices.
What are the advantages of using a linked list to represent a graph?
High performance for dense graphs
Automatic sorting of vertices
Fixed size for all edges
Efficient memory usage, easy addition/removal of edges and vertices, and suitability for sparse graphs.
