The binary-tree tag has no wiki summary.
4
votes
4answers
447 views
Usefulness of pre and post order traversal of binary trees
This may be very naive, but I was wondering, it the context of binary trees (plain, sorted and balanced), of all the traversal types:
depth-first pre-order
depth-first in-order
depth-first ...
24
votes
5answers
1k views
Programming interview question on Trees
I was asked this interview question at a top internet website company recently and I kinda was stumped by it.
Certain empty glasses of water are arranged in the following order
When you pour ...
3
votes
2answers
458 views
Morse Code - Binary Tree
How is the Morse Code representation of a letter determined?
"E" = "."
"T" = "-"
Why is it not alphabetic? As in let "A" = ".", "B" = "-", "C" =".-", etc.
I'm trying to develop an algorithm for a ...
4
votes
1answer
296 views
What is the usage of Splay Trees in the real world?
I decided to learn about balanced search trees, so I picked 2-3-4 and splay trees.
What are the examples of splay trees usage in the real world?
In this Cornell: ...
2
votes
1answer
448 views
Keeping binary search tree balanced
I am educating myself on algorithms and data structures. For that, I am doing a simple program that would read lines like this:
bdhj 168.24
dahf 42.88
dhfa 128.92
First column represents an account ...
0
votes
1answer
280 views
How should I setup a UI for editing a binary tree?
I need to allow the user to create an binary tree. I have a Backbone Model populating properly from the database, the problem I am stuck on is how do I setup the ui elements in a way that is fairly ...
0
votes
1answer
217 views
Why can't an AVL tree be recreated using pre-order traversal?
Given a binary search tree, I understand why I can use breadth-first and pre-order traversal to list the entries of the tree in such a way as to reconstruct the tree in the order in which its ...
5
votes
2answers
456 views
Do you get the benefits of a B-Tree in a managed language?
My understanding is that one of the key features of a B-Tree (and a B+Tree) is that it is designed such that the size of its nodes are some multiple of the block size of whatever media the data is ...
-3
votes
1answer
314 views
How the operations work in a Binary Tree?
Search, Insert and Deletion. How those properties work in a Binary Tree? How much I read articles and all nothing worked, still I cannot understand it well. Please help me with this. I want to know it ...
4
votes
2answers
295 views
Is this the right strategy to convert an in-level order binary tree to a doubly linked list?
So I recently came across this question - Make a function that converts a in-level-order binary tree into a doubly linked list. Apparently, it's a common interview question.
This is the strategy I ...
3
votes
2answers
506 views
Speed of MySQL type index access vs. binary jump search on a huge file?
I am dead set on moving over to a MySQL database for some huge data sets I'm working with but right now I don't have the time. In the meantime I am curious about a technical performance issue ...
0
votes
3answers
601 views
AVL Tree Balancing Problem
Take the following tree:
50
40
30
20
10
Which node will be balanced first? 50 or 30
Case 1: 50
The tree is
30
20 40
...
5
votes
6answers
2k views
Which self balancing binary tree would you recommend?
I'm learning Haskell and as an exercise I'm making binary trees. Having made a regular binary tree, I want to adapt it to be self balancing. So:
Which is most efficient?
Which is easiest to ...