Scaler
Practice
Resources
Contests
Online IDE
New

## Welcome to Interviewbit, help us create the best experience for you!

Currently, You are a:

College/University *
Enter the name of your college
Branch *
Year of completion *

College/University *
Enter the name of your college
Branch *
Year of completion *

Current Company *
Enter company name
Experience *

## You're all set!

Full name *
Email *

By creating an account, I acknowledge that I have read and agree to InterviewBitâ€™s Terms and Privacy Policy .

Email *

# Tree Data Structure

### Important tutorials

1. Introduction To Tree Data Structure
2. Binary Tree
3. Binary Search Tree
4. Implementation Of Bs Ts

## Serious about Learning Programming ?

Learn this and a lot more with Scaler Academy's industry vetted curriculum which covers Data Structures & Algorithms in depth.
Examples

## Tree Data Structure Problems

Bst traversal
Problem Score Companies Time Status
Valid BST from Preorder 100 58:47
Kth Smallest Element In Tree 300 29:17
2-Sum Binary Tree 400 63:52
BST Iterator 500 41:27
Recover Binary Search Tree 750 65:00
Trie
Problem Score Companies Time Status
Xor Between Two Arrays! 150 45:07
Hotel Reviews 200 74:15
Shortest Unique Prefix 350
69:06
Simple tree ops
Problem Score Companies Time Status
Path to Given Node 200 40:47
Remove Half Nodes 200 45:39
Nodes at Distance K 200 51:35
Balanced Binary Tree 275 30:19
Maximum Edge Removal 300 47:22
2 trees
Problem Score Companies Time Status
Merge two Binary Tree 200 30:26
Symmetric Binary Tree 300 22:00
Identical Binary Trees 300 11:36
Traversal
Problem Score Companies Time Status
Vertical Order traversal of Binary Tree 200 73:56
Diagonal Traversal 200 46:36
Inorder Traversal 350 32:00
Preorder Traversal 350 15:26
Postorder Traversal 350 31:28
Level order
Root to leaf
Problem Score Companies Time Status
Burn a Tree 200 54:30
Max Depth of Binary Tree 350 6:57
Sum Root to Leaf Numbers 350
45:33
Path Sum 350 27:35
Min Depth of Binary Tree 350 17:20
Root to Leaf Paths With Sum 350 41:13
Inplace change
Problem Score Companies Time Status
Invert the Binary Tree 300
12:46
Tree search
Problem Score Companies Time Status
Least Common Ancestor 450 57:33
Problem Score Companies Time Status
Flatten Binary Tree to Linked List 500 43:45
Segment tree
Problem Score Companies Time Status
Order of People Heights 700
75:32

Free Mock Assessment
Help us know you better for the best experience
Current Employer *
Enter company name
Enter university name
Phone Number *
OTP will be sent to this number for verification
+91
+91
+247
+376
+971
+93
+1
+1
+355
+374
+244
+54
+1
+43
+61
+297
+358
+994
+387
+1
+880
+32
+226
+359
+973
+257
+229
+590
+1
+673
+591
+599
+55
+1
+975
+267
+375
+501
+1
+61
+243
+236
+242
+41
+225
+682
+56
+237
+86
+57
+506
+53
+238
+599
+61
+357
+420
+49
+253
+45
+1
+1
+213
+593
+372
+20
+212
+291
+34
+251
+358
+679
+500
+691
+298
+33
+241
+44
+1
+995
+594
+44
+233
+350
+299
+220
+224
+590
+240
+30
+502
+1
+245
+592
+852
+504
+385
+509
+36
+62
+353
+972
+44
+246
+964
+98
+354
+39
+44
+1
+962
+81
+254
+996
+855
+686
+269
+1
+850
+82
+965
+1
+7
+856
+961
+1
+423
+94
+231
+266
+370
+352
+371
+218
+212
+377
+373
+382
+590
+261
+692
+389
+223
+95
+976
+853
+1
+596
+222
+1
+356
+230
+960
+265
+52
+60
+258
+264
+687
+227
+672
+234
+505
+31
+47
+977
+674
+683
+64
+968
+507
+51
+689
+675
+63
+92
+48
+508
+1
+970
+351
+680
+595
+974
+262
+40
+381
+7
+250
+966
+677
+248
+249
+46
+65
+290
+386
+47
+421
+232
+378
+221
+252
+597
+211
+239
+503
+1
+963
+268
+290
+1
+235
+228
+66
+992
+690
+670
+993
+216
+676
+90
+1
+688
+886
+255
+380
+256
+1
+598
+998
+39
+1
+58
+1
+1
+84
+678
+681
+685
+383
+967
+262
+27
+260
+263
+979
Change Number
Edit
Resend OTP
By clicking on "Continue" I agree to be contacted by Scaler in the future.