Top "Binary-tree" questions

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

Deletion procedure for a Binary Search Tree

Consider the deletion procedure on a BST, when the node to delete has two children. Let's say i always replace …

algorithm data-structures binary-tree binary-search-tree
Binary Tree in Objective-C

I am learning algorithms and data structures and to train I am trying to design and implement a binary tree …

objective-c ios binary-tree binary-search-tree
cannot cast to java.lang.Comparable

Although this question has already been asked but I have an implementation specific doubt. I am trying to print the …

java binary-tree classcastexception tree-traversal
C# Display a Binary Search Tree in Console

I have simple binary search tree public class BNode { public int item; public BNode right; public BNode left; public BNode(…

c# console binary-tree
Deep Copy Constructor for binary tree

I am trying to create a deep copy of my binary tree data structure in C++. The problem is the …

c++ binary-tree copy-constructor deep-copy shallow-copy
print level order traversal of binary tree in Zigzag manner

I have to print the nodes of a binary tree using level order traversal but in spiral form i.e …

algorithm binary-tree tree-traversal
Post-order/Pre-order Traversal of Binary Tree

I have a pre-order traversal function that looks like this: void listInPreOrder(node* hd){ if(hd != NULL) { printf("%d, ", hd-&…

c recursion tree binary-tree postorder
Iterating over a Binary Tree with O(1) Auxiliary Space

Is it possible to iterate over a binary tree in O(1) auxiliary space (w/o using a stack, queue, etc.), …

algorithm language-agnostic tree memory-management binary-tree
Red-Black Trees

I've seen binary trees and binary searching mentioned in several books I've read lately, but as I'm still at the …

algorithm binary-tree red-black-tree
Print a binary tree, python, in inorder

Me and my friend are doing some school work with programming in Python 3.1 and are VERY stuck. We're programming a …

python printing binary-tree inorder