Top "Binary-tree" questions

A tree data structure in which each node has at most two child nodes.

Write a non-recursive traversal of a Binary Search Tree using constant space and O(n) run time

This is not homework, this is an interview question. The catch here is that the algorithm should be constant space. …

java binary-tree traversal tree-traversal
Is Big O(logn) log base e?

For binary search tree type of data structures, I see the Big O notation is typically noted as O(logn). …

math binary-tree complexity-theory big-o
The most efficient way to test two binary trees for equality

How would you implement in Java the binary tree node class and the binary tree class to support the most …

java algorithm data-structures binary-tree
How to Serialize Binary Tree

I went to an interview today where I was asked to serialize a binary tree. I implemented an array-based approach …

serialization tree binary-tree flatten binary-search-tree
balancing an AVL tree (C++)

I'm having the hardest time trying to figure out how to balance an AVL tree for my class. I've got …

c++ algorithm data-structures binary-tree avl-tree
Real world examples of tree structures

I'm looking for some examples of tree structures that are used in commercial/free software projects, modern or old. I …

tree binary-tree binary-search-tree
Determine if two binary trees are equal

What would be the efficient algorithm to find if two given binary trees are equal - in structure and content?

algorithm binary-tree
Balancing a Binary Tree (AVL)

Ok, this is another one in the theory realm for the CS guys around. In the 90's I did fairly …

algorithm computer-science binary-tree theory avl-tree
check if a tree is a binary search tree

I have written the following code to check if a tree is a Binary search tree. Please help me check …

java algorithm data-structures binary-tree
B-tree faster than AVL or RedBlack-Tree?

I know that performance never is black and white, often one implementation is faster in case X and slower in …

algorithm data-structures binary-tree