import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Random;
I have BST of BTNode<E>\'s each has double number and I have the following fields: BTNode <E> root: a pointer to the root of the tree
My project is a Phonebook that is using BSTree<E>. Each node of the tree is BTNode<E>. In the main class, I replace E with Pair class, which has (String name, String number), when I define
I can find an element in a sorted set (backed by BST) in O(logN). Now I would like the index of this element. For example, in set {1, 3, 4, 10}, the index of 4 is 2 and the index of 1 is 0.
EDIT there a small thing that I am missing!! the error is still there So I am attempting to learn how to code my first BST, and it is hard.... I am already having trouble with just a few lines of cod
So I am attempting to learn how to code my first BST, and it is hard.... I am already having trouble with just a few lines of codes. the problem is in the insert, but I have included everything so tha
Hey, So I want to create a new tree which is basically the intersection (mathematical definition of intersection) of 2 given binary search trees. I have a method that prints out all the nodes at a par
Either I\'ve been staring at this code for way too long or I just can\'t figure this one out.but when I use an 8000 number text file in descending order; 8000, 7999, ... I get a segmentation fault in
This is pseudo homework (it\'s extra credit).I\'ve got a BST which is an index of words that point to the lines (stored somewhere else) that contain the words.I need to implement a way to search using
node ** BST :: searchElement(node **tree, int item) { if( ((*tree)->data == item) || ( (*tree) == NULL) )