Top "Binary-tree" questions

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

Looking for fast algorithm to find distance between two nodes in binary tree

How do I find the distance between two nodes in a binary tree? Equivalently, what algorithms are there for finding …

algorithm binary-tree
Objects that represent trees

Are there any objects in C# (or in .net) that represents a binary tree (or for curiosity) and n-ary tree? …

c# .net tree binary-tree
print all root to leaf paths in a binary tree

i am trying to print all root to leaf paths in a binary tree using java. public void printAllRootToLeafPaths(Node …

java tree binary-tree
Number of binary search trees over n distinct elements

How many binary search trees can be constructed from n distinct elements? And how can we find a mathematically proved …

algorithm math binary-tree binary-search-tree proof
How to construct BST given post-order traversal

I know there are ways to construct a tree from pre-order traversal (as an array). The more common question is …

algorithm recursion binary-tree binary-search-tree
Finding the location of a parent node in a binary tree

So I need help coming up with an expression that will always give me the location of a child's parent …

c++ tree binary-tree parent-child uncertainty
Using arrow -> and dot . operators together in C

I was under the impression that it was possible to access data from a sub-node of a linked list or …

c heap binary-tree
What is the left-child, right-sibling representation of a tree? Why would you use it?

Many data structures store multi-way trees as binary trees using a representation called the "left-child, right-sibling" representation. What does this …

data-structures tree binary-tree multiway-tree
Is the root node an internal node?

So I've looked around the web and a couple of questions here in stackoverflow here are the definition: Generally, an …

data-structures tree binary-tree nodes treenode
Why use binary search if there's ternary search?

I recently heard about ternary search in which we divide an array into 3 parts and compare. Here there will be …

algorithm data-structures binary-tree ternary-tree