I wonder how I should use the GTree (from GLib) to store data? Every new value I insert into GTree with g_tree_insert routine is overwrite the previous one!
I\'m quite new to C and I\'m trying to implement a binary tree in C which will store a number and a string and then print them off e.g.
I\'m a Python guy. Learning C language and I\'ve been trying to implement Binary Search Tree in C. I wrote down the code, and I\'ve been trying from few hours but, not able to get the output as expect
I want to make my avl-tree support duplicate keys but there is a problem with the default behavior of the binary search tree with duplicates that the rotation could make nodes with equal key be on the
if right[x] != NIL then return TREE-MINIMUM(right[x]) y<-p[x] while y!= NIL and x = right[y] do x<-y
I am trying to calculate the height of a tree. I am doing it 开发者_StackOverflow社区with the code written below.
This is supposed to tra开发者_如何学Goverse a BST and delete every node, including the root node.However, at the end, I get the message \"root still has a left node.\"Why aren\'t all nodes deleted?
I\'m struggling with the concept of when to use binary search trees and when to use dictionaries. In my application I did a little experiment which 开发者_StackOverflow社区used the C5 library TreeDic
What\'s wrong with the following implementation of a binary search tree (BST)? I have been told that it is better to use pointer to a pointer to struct node as an argument in insert function.
I am trying to search for a word using a key value recursively. In retrieve function: Problem is the index goes from 0, 1,3,7, to 15.... it suppose to go 0,1,3,7,8 and so forth