TCS Ninja Questions on Trees Quiz-1

Question 1

Time: 00:00:00
For the binary tree shown in the figure , the in-order traversal sequence will be

Trees Inorder

HDIJBKEALFMCNGOA

HDIJBKEALFMCNGOA

HDIBJEKALFMCNGOA

HDIBJEKALFMCNGOA

HIDJBKEALFNCMGOA

HIDJBKEALFNCMGOA

HIDJBEKLAMFCNOGA

HIDJBEKLAMFCNOGA

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00



Assuming that the tree's height starts from 0. Then number of nodes in a tree of height h will be?



 

 

2h

2h

(2h -1)

(2h -1)

(2h + 1 - 1)

(2h + 1 - 1)

(2h -1 -1)

(2h -1 -1)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
The data structure used by level order traversal binary tree:

Linked List

Linked List

Queue

Queue

Array

Array

Stacks

Stacks

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
For the binary tree shown in the figure , the pre-order traversal sequence is

Trees PreOrder

10 11 12 15 18 22 25 35 44 50 64 66 70 90

10 11 12 15 18 22 25 35 44 50 64 66 70 90

25 15 10 12 11 22 18 35 50 44 66 70 64 90

25 15 10 12 11 22 18 35 50 44 66 70 64 90

25 15 10 12 11 22 18 50 35 44 70 66 64 90

25 15 10 12 11 22 18 50 35 44 70 66 64 90

11 12 10 18 15 22 44 35 64 66 90 70 50 25

11 12 10 18 15 22 44 35 64 66 90 70 50 25

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
 A binary tree where all the node have either two children or zero is known as

Full binary tree

Full binary tree

Complete binary tree

Complete binary tree

Binary search tree

Binary search tree

AVL binary tree

AVL binary tree

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
If the preorder and inorder traversal of the binary tree is ABDEFCGHJLK and DBFEAGCLJHK respectively so what is the postorder traversal.?

DFEBGLJKHCA

DFEBGLJKHCA

DFEBLJGKHCA

DFEBLJGKHCA

DFEBLKHGJCA

DFEBLKHGJCA

DFEBLGKJHCA

DFEBLGKJHCA

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
If 11, 6, 7, 9,10,8,12,15 is inserted in the tree, so what will the height of the binary search tree?

2

2

6

6

4

4

5

5

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
The preorder and inorder traversal of the tree is ABDEFCGHJLK and DBFEAGCLJHK respectively so design the tree.



B.





A

A

B

B

C

C

D

D

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What is the maximum number of nodes in full binary tree which have a depth 3 ?

4

4

10

10

15

15

12

12

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
 What is the depth of the following binary tree?

1

1

2

2

3

3

4

4

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/10

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments