139 Topics

Member Avatar for
Member Avatar for virtualvinodh

Hi, I wrote a piece of code for doing a recursive printing of all the leaf nodes. But it is not moving beyond one or two levels. Here is the code: [code=php] $root = array( "paa" => array ( "adi1" => array ( "cir1" => array ( "aka", "ra", "vinodh","dkido" …

Member Avatar for virtualvinodh
0
240
Member Avatar for xxpokerxx

Hi, I am trying to implement a binary tree(not sorted) using recursion. I have figured out most of my function however GetMax and GetMin are confusing me. [CODE]#include <stdio.h> #include <stdlib.h> #include <limits.h> typedef int TreeEntry; typedef struct binary_tree_node { TreeEntry item; struct binary_tree_node * left; struct binary_tree_node * right; …

Member Avatar for xxpokerxx
0
265
Member Avatar for Drakarus

Problem 1: I was wondering if it's possible to add for example the struct below into a binary tree: [CODE=c] struct Appoint { string place; string title; int hour, minute; int durationHr, durationMin; }; [/CODE] I want the above struct to be sorted in the binary tree by hour and …

Member Avatar for Drakarus
0
264
Member Avatar for sasTReSS

Hi everyone, i want to ask question about how to make a multiple tree in c++. So i want to make a tree which contain more than 2 child(or node or leaf), but i don't know how to make a tree like this. does anyone have an example about this? …

Member Avatar for sasTReSS
0
984
Member Avatar for circusfreak

Creating a program to read a text file full of words in alphabetical order. I then have to read it into a Linked List. The linked list should output total number of words, which I have managed to do. After this it needs to calculate the min and max depth …

Member Avatar for NormR1
0
130
Member Avatar for alllucky7s

So this is my problem: as the title suggests, I have a Labyrinth class that contains two binary trees made of two different kinds of structs that represent different kinds of rooms. The names are in spanish, so Arbol means tree, Laberinto is the labyrinth class and Sala1 and Sala2 …

Member Avatar for alllucky7s
0
208
Member Avatar for phummon

Hi everyone, I'm a relative beginner to writing UNIX scripts. In the past, I've been able to hack together simple scripts. Now I need a script which a little more complex than I'm used to, and I really need help. I'm up against a tight deadline and am growing desperate, …

Member Avatar for phummon
0
164
Member Avatar for esy928

Good Day! I'm a little bit lost right now on how to implement trees in java. We were ask to do a program that will display relationships (1st/2nd degree friends). I'm thinking of using vectors but our teacher said that we have to use Abstract Data Types (Trees). I've tried …

Member Avatar for jwenting
0
126
Member Avatar for CrazyProgrammer

Hi, Could somebody please show me and example of how to iterate through an n-nary tree, where I do not know what n is and n could be different for every node ie the root node could have 3 children and each child might only have 2 children etc, I …

Member Avatar for john.double
0
204
Member Avatar for swinefish

Hey all I'm trying to write a Multiple Document Summary (MDS) system as proposed by Chali et al. (2009), see attached. And after a lot of reading I've managed to wrap my head around a lot of the concepts. However, one of the things I need to make is a …

Member Avatar for jk451
0
142
Member Avatar for evilsweeps

Hi, this is my first post on here so forgive me if my question or code is unclear. I'm coding a binary search tree and I'm stuck on the overloaded ==operator. [CODE] //BSTCLASS.CPP template <class ItemType> void BstClass<ItemType>::rFindNode(node<ItemType>* trav,ItemType& item,node<ItemType>* rtTrav, ItemType& rtItem, bool& equal)const { rFindNode(trav->left, trav->left->data, rtTrav->left, rtTrav->left->data, …

Member Avatar for evilsweeps
0
263
Member Avatar for Kennych

Hey can anyone tell me whats wrong with my code? I'm getting a program freeze. [url]http://i47.tinypic.com/wh1ez5.png[/url] I'm doing a binary search tree, BST.CPP [url]http://pastebin.org/57667[/url] Person.CPP [url]http://pastebin.org/57669[/url] TreeNode.CPP [url]http://pastebin.org/57670[/url] Main---Where I call the searchTreeInsert function [url]http://pastebin.org/57674[/url]

Member Avatar for programmersbook
-1
146
Member Avatar for arshad115

hi,i am making trees and i want to draw the structure of the tree in windows forms applications.since the class tree has the access to the trees root pointer.so only a member function of the class can draw the nodes of that tree. but i cannot use the graphics pointer …

0
151
Member Avatar for simonsayz27

Hey everyone. I first post and I couldn't figure out how to encase my code, sorry. Let me know and I'll do it next post. Anyways, I've built binary tree using recursion and included a function to print out the sum of the level of the tree of a given …

Member Avatar for codewalkz
0
352
Member Avatar for TigerGirl

Hello I am trying to read a node that will find the longest word in a tree. So, my method is a public static int word(Node d) So how would I have to find the length of that node? Would I just use the string that was made in the …

0
107
Member Avatar for TigerGirl

So, I have to write a public static method add, which takes a parameter, and adds up all the values in the N-ary tree it represents. Characterize the traversal order: preorder. - what does that mean???? So, can someone explain to me how I would do this??? thanks.

Member Avatar for kvprajapati
0
71
Member Avatar for jakethesnake86

I got the following code out of Carrano's Walls & Mirrors. I made a few changes but have tested it and it works. I'm really confused by line 19 in the .h file. Why is it structured like "void (*FunctionType)"? Why not (void*) FunctionType? or void* FunctionType? What is the …

Member Avatar for ross42111
0
124
Member Avatar for TigerGirl

Hi. I have a recursive public static method search that takes a Tree node (any arbitrary binary tree, not necessarily a search tree) and returns whether or not that tree satisfies the order property for a binary search tree. So, my method is [CODE]public static boolean search(TN t) { if …

Member Avatar for TigerGirl
0
201
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

The End.