185 Topics

Member Avatar for
Member Avatar for mindbend

Hello people, I decided to make a family tree as a graduation project, I've thought about multiple ways to make it, but I like some fresh ideas, in case i forgot some things. I'm trying to keep the project as easy as possible, because in the end I will need …

0
146
Member Avatar for araisbec

Alright, so I've spent countless hours on this code and I need a fresh pair of eyes to give it a glance... This is my third assignment for my datastructures class, where I am to write code that turns a fully parenthesized expression (such as "((3+2)/(3-8))") into aan "arithemtic expression …

Member Avatar for araisbec
0
676
Member Avatar for chupoi

Hi there ! I have a tree view control and a button in Form1. The button takes me to Form2 which has a text box and a save button. What I'm trying to do is get the button on Form2 to add what i have typed in the textbox as …

Member Avatar for kvprajapati
0
138
Member Avatar for Awesomeness

I have a tree, and I want to find the depth of it. For example for this tree: [CODE]0 root / \ 1 5 1 / \ 2 1 3 | 3 2[/CODE] It should give a depth of 3. [CODE] public int getDepth() { int maxDepth = 0; if(this.hasChildren()) …

Member Avatar for Awesomeness
0
110
Member Avatar for crossbow25

[CODE] #ifndef VECTORBINARYTREE_H #define VECTORBINARYTREE_H template<typename Object> class ArrayVector{ private: int capacity; int sz; Object* a; protected: void overflow() { capacity*=2; Object* b=new Object[capacity]; for(int i=0;i<sz;i++) b[i]=a[i]; delete []a; a=b; } public: ArrayVector(int initCap=16){ capacity = initCap; sz=0; a = new Object[capacity]; } int size() const {return sz;} bool isEmpty() …

0
85
Member Avatar for ComradePatriot

My first post on this forum, long time lurker though. I'm running into a problem trying to search through an N-ary tree. I'm tasked with having the user input pairs of job titles and from there putting them into an N-ary tree, with the higher job titles at higher levels. …

Member Avatar for alwaysLearning0
0
584
Member Avatar for davecoventry

What I have is a list of file paths: dir0/file0.txt dir0/dir1/filea.txt dir0/file1.txt dir0/dir1/fileb.txt dir0/dir1/dir1/filec.txt dir0/file2.txt What I'd like to get is something like the following: [code] $paths=Array( file0.txt=>file0.txt, dir1=>Array( filea.txt=>filea.txt, fileb.txt=>fileb.txt, dir1=>Array( filec.txt=>filec.txt ) ), file1.txt=>file1.txt, file2.txt=>file2.txt ); [/code] It strikes me that this must be a fairly common requirement …

Member Avatar for diafol
0
2K
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 girlzone

Hello all, I have a question: What are the advantages & disadvantages of the circular linked list compared with: a. Usual linked list b. Doubled linked list Although the implementation of the usual list functions & the circular list functions are similar…when do we have to use it?? or in …

Member Avatar for Martin B
0
448
Member Avatar for Slimmy

Hi! I have an array of doubles that I map to a hashmap to keep track of the indices of the elements. I want to be able to sort the array and still keep track of the indices and thats no problem as long as the elements are distinct. But …

Member Avatar for Slimmy
0
123
Member Avatar for neil_mahaseth

Is there any difference between a sorted link list and an ordered link list? If there is any difference please show it by giving an example. Thanks

Member Avatar for Narue
0
199
Member Avatar for titan_31

I wrote this simple program in C to generate binary search tree, but i am unable to go beyond level 0. Note that I have not incorporated the printing part. [code] #include<stdio.h> #include<malloc.h> struct node { int data; struct node *lc; struct node *rc; }*start,*link,*tmp; int a[100]; int main() { …

Member Avatar for Narue
0
174
Member Avatar for dansnyderECE

0 down vote favorite I'm trying to figure out how exactly to use stat() to capture information about a file. What I need is to be able to print several fields of information about a file. So.. [CODE] #include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> using namespace std; int …

Member Avatar for dansnyderECE
0
484
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
242
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
280
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
270
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
994
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
135
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
165
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
219
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
146
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
267
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
147
Member Avatar for Benderbrau

Hi guys, I've searched this, but can't find a solution. Basically what I'm doing is writing a binary search tree (which works) and balancing it with AVL (which almost works). As far as I can tell my AVL tree is implemented correctly, but I'm getting a stack overflow error at …

Member Avatar for Geekitygeek
1
584
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
152
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
353
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
108
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

The End.