185 Topics
| |
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 … | |
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 … | |
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 … | |
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()) … | |
[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() … | |
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. … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 | |
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() { … | |
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 … | |
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" … | |
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; … | |
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 … | |
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? … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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, … | |
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] | |
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 … | |
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 … | |
| 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 … |
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 … | |
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. |
The End.