WorksheetsPythonDS
Total questions: 20
Worksheet time: 11mins
Post order traversal :
1a+b*c+d*e+f*g
1abc*+de*f+g*+
++a*bc*+*defg
abc+*+defg*+*
In Order traversal
40 20 50 10 30
40 50 20 30 10
10 20 30 40 50
50 40 20 30 10
What is the MAXIMUM number of nodes in a binary search tree with height = 5 ?
26-1
25-1
25
26
6
What is the MINIMUM number of nodes in a binary search tree with height = 5?
6
5
26-1
25-1
25
What is the worst-case runtime of lookUp/get in a binary search tree?
O(n)
O(logn)
O(1)
O(n2)
What is the worst-case runtime of lookUp/get in a *perfectly balanced* binary search tree?
O(logn)
O(n)
O(1)
O(n2)
What is the value of the ROOT node in this Tree?
35
24
42
20
Root
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
the starting node in a rooted tree structure from which all other nodes branch off./
Binary TREE
data structure similar to a graph, with no loops.
an object in a graph also known as a vertex
a join of relationship between nodes - also know as an arc
a tree where each node can only have 2 child nodes attached to it
In preorder traversal of a binary tree the second step is ____________
traverse the right subtree
traverse the left subtree
traverse right subtree and visit the root
visit the root
How many leaf are there in the tree?
1
3
4
7
Which of these tree traversal methods is used to output the contents of a binary tree in ascending order?
Pre-Order
In-Order
Post-Order
Monastic Orders
When traversing a binary tree, which diagram is post-order?
When traversing a binary tree, which diagram is pre-order?
A Data Structure is:
A C++ vector
A way of organizing, storing and performing operations on data.
A function in any programming language
A sequence of steps to solve a problem.
