49 Topics

Member Avatar for
Member Avatar for quetzal_7

Hi, help please! I have a struct containing an array of pointers to structs containing Binary Search Trees with nodes containing structs. ... <*sigh*> I hate C soo much... put work wants it to be in C. I can set the struct of BST's just fine, and keep it around, …

Member Avatar for Ancient Dragon
0
205
Member Avatar for sajay

Hello I'm coding an algorithm based on genetic programming with tree structures in C. I implemented tree structure using recursive structure pointers **The traditional way** [CODE] struct tree { int val; tree *left; tree *right; }; tree a[10]; tree b[20]; void main() { generate (); // this generates me 10 …

Member Avatar for sajay
0
186
Member Avatar for can_surmeli

Hi. I've a BST created for an address book application for my term project. When inserting into the BST, I insert items sorted by their first names in ascending order. The thing is that the user should be able to display the BST in the ascending form of last names …

Member Avatar for TrustyTony
0
698
Member Avatar for can_surmeli

Hi all. As a part of my project I need to get the address book information saved in a .txt file into a Binary Search Tree. The info in the address book is stored like the following: First Name, Last Name, Date of Birth, E-mail, Phone, Address, City, Zipcode So …

Member Avatar for can_surmeli
0
2K
Member Avatar for group256

Dear experts in Python, I have written a binary search method that receives a list of float and one new float item. It needs to look for the proper index for that item to be placed and return that index. To make it simple, I give an example: imagine a …

Member Avatar for group256
0
180
Member Avatar for Hockeyfreak889

i need to make a program that implements a heapsort using a binary tree. i understand the algorithm for how to do the sort, and i understand how it would be done using an array, but for my class i have to use a binary tree. The problem i am …

0
77
Member Avatar for lauw0203

Hello :) I'm creating a license plate recognition system for my coursework at University. We need to use Binary trees, which I've done but the information needs to be stored in a file to read and write to. I've created some text files with XML tags in for Cars, Lorries, …

Member Avatar for lauw0203
0
175
Member Avatar for PtblDuffy

Hello, I've been looking at this problem for a few hours, and I can't figure it out. We had to test this code and fix it if we find errors (it's a splay tree): [CODE] public class SplayBST { Node root; int count; int level = 0; public SplayBST() { …

Member Avatar for PtblDuffy
0
217
Member Avatar for keicola

hi, i'm currently learning C on my own. i explicitly made a binary tree just to see if my postorder procedure works. i have no idea why but at the end of running the program, before it does the last procedure, this appears: [IMG]http://i56.tinypic.com/2nb52xx.jpg[/IMG] everything else works fine. i know …

Member Avatar for keicola
0
168
Member Avatar for bkoper16

I need help with a program that is supposed to take data on football players from a txt file and place them in a binary search tree then use case statements to t osearch the tree inorder, preorder and postorder recursively here's what i got so far [CODE] /* Bradley …

Member Avatar for Narue
0
186
Member Avatar for bkoper16

I am doing a project where i have to insert a list of players and stats into a binary search tree Here is the project description For this final assignment, you will be creating a binary search tree. You will be able to utilize some of your previous assignment code, …

Member Avatar for bkoper16
0
874
Member Avatar for schoolboy2010

Hi, My program is supposed to implement a binary tree with an insert, remove, copy, pre-order, post-order and in-order functions. Problem is that my code compiles but doesn't work correctly. When I try to insert more than one node/child node the program crashes/freezes. Could someone help me out. Thanks. header …

0
197
Member Avatar for sid78669

I recently had an assignment for an advanced coding class where I was to create a Binary tree from inorder and preorder traversals. I first started out by creating my ADT for binary trees and working with that to create a new tree. The way I worked it was that …

Member Avatar for arkoenig
0
154
Member Avatar for peterman.k

I am going out of town and don't have access to my professor and / or tutors for the weekend, and we have an assignment involving a BST. I have done all of my insert, remove, and search functions, and went to the tutor about the remaining ones I have, …

Member Avatar for peterman.k
0
227
Member Avatar for vandna

hey i tried to make a program to find an item in an integer array using binary search technique n by iteration with the help of functions...but i am getting errors....so plz help me out..

Member Avatar for Grn Xtrm
-2
129
Member Avatar for vandna

hey m a new user so didnt knw it... nywyas here's the program i made.. /*A PROGRAM TO SEARCH AN ELEMENT IN 1D ARRAY USING BINARY SEARCH USING ITERATION*/ #include<stdio.h> #include<conio.h> void binary(int array[],int n,int ele) { int beg=0; int end=n-1; int mid; mid=(beg+end)/2; while((beg<=end)&&(array[mid]!=ele)) { if(ele>array[mid]) beg=mid+1; else end=mid-1; …

Member Avatar for Ancient Dragon
-1
135
Member Avatar for markrezak

//Binary Search Tree Program #include <iostream> #include <cstdlib> using namespace std; class BinarySearchTree { private: struct tree_node { tree_node* left; tree_node* right; int data; }; tree_node* root; public: BinarySearchTree() { root = NULL; } bool isEmpty() const { return root==NULL; } void print_inorder(); void inorder(tree_node*); void print_preorder(); void preorder(tree_node*); void …

Member Avatar for dkalita
-1
432
Member Avatar for hny_lyn

To begin, we were asked to make a TREE... It says that we should traverse the left subtree of the ROOT/NODE in postorder and then make a copy of it... Next is to traverse the right subtree of the ROOT/NODE in postorder and then make a copy of it... Lastly, …

Member Avatar for quuba
0
525
Member Avatar for Der_sed

[CODE]#include <iostream> #include <cstdlib> using namespace std; const int arrSize = 100; bool isPresent(int ,int ); int main() { int myArr[arrSize]; int input; for (int i=0; i<=arrSize; i++) myArr[i]=rand()%200; //creating array with random numbers //sorting random numbers for (int j=0; j<=arrSize; j++){ for(int k=0; k<j ; k++){ if (myArr[j] < …

Member Avatar for VernonDozier
0
91

The End.