185 Topics

Member Avatar for
Member Avatar for eldiablo1121

Hello, I'm trying to write a program that takes an input file name and lists the folders in a heirarchy ex.Folder subfolder etc I have most of my code, but I'm getting 2 errors that are connected and I have no idea how to fix it. Here is my code: …

Member Avatar for eldiablo1121
0
268
Member Avatar for krystosan

How should I make an entry appended to existing entries instead of overwriting the whole file ? class ReadWriteCustomPathsToDisk(object): """docstring for ReadWriteCustomPathsToDisk""" def __init__(self, modulePath): super(ReadWriteCustomPathsToDisk, self).__init__() self.modulePath = modulePath def _xmlFileLocation(self): xmlFileLocation = os.path.join(os.path.expanduser("~"), "Documents","searchMethod","modules.xml") return xmlFileLocation if os.path.exists(xmlFileLocation): return xmlFileLocation def readXml(self): xmlFile = self._xmlFileLocation() root = etree.parse(xmlFile).getroot() …

0
111
Member Avatar for sneha_

[CODE]//To convert postfix expression into an expression tree #include"stdio.h" #include"conio.h" #include"process.h" #include"string.h" #include"stdlib.h" struct node{ char item; struct node *lnode; struct node *rnode; }*stc[30],*temp,*root; typedef struct node *NODEPTR; char expression[50]; char c; int top=0; NODEPTR pop(); void push(NODEPTR); void getinput(); void inorder(NODEPTR p); int main (){ getinput(); int i,j; for(i=0;i<strlen(expression);i++) …

Member Avatar for deceptikon
0
2K
Member Avatar for xXFalcoPunchXX

I need help in building a binary tree and putting integers in it. I need to write an add method in my MyArrayBinaryTree class (that extends ArrayBinaryTree) that allows me to place the element to be added in the very next available slot in the array. I also need to …

Member Avatar for JamesCherrill
0
362
Member Avatar for somjit{}

Since the underlying data-structure used here is an array , which is itself iterable via `for-each()` , i'm wondering how much benefit implementing `Iterable` will provide here. I would appreciate if someone could review my code and suggest any further improvements. **Code:** import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; class ResizingCircularArray<E> …

Member Avatar for somjit{}
0
1K
Member Avatar for pdwivedi

Hi all, I want to create all possible combinations of a full binary tree which must have exactly 4 leaf nodes and 3 internal nodes. I want to create it using recursion and tree must be simple binary tree not a binary search tree or BST. Kindly suggest algorithm to …

Member Avatar for pdwivedi
0
493
Member Avatar for Stju

Let's use the basic example.. I have a table for tree representation with just 3 columns: ID, PARENT_ID,NAME. If I delete a record X, how can I delete all recursive records that refer as PARENT_ID of deleted record?

Member Avatar for Rahul47
0
126
Member Avatar for best4earn

I have created my binary tree as , It Shows in List Perfectly but i want to show in Genealogy , how can we do this ..I have Pasted My Total Nodes Script Here with HTML & java script for making tables & draw lines btwn nodes . When I …

Member Avatar for best4earn
1
3K
Member Avatar for harde_1

Im trying to add Total function and isMono functions to this code. Did total already Need help with function ismono which returns whether a tree is mono (all the elements are unique aka no element appears more than one time) or not. Please this is the original program #ifndef T_H …

Member Avatar for deceptikon
0
307
Member Avatar for harde_1

Hi, I need a function that will take a tree as argument and return the number of ints that were typed and a correct call. would it just be preorder? like below. Please. Thanks #include "t.h" void preorder(tnode * t){ if (t == NULL) return; cout << t->info <<endl; preorder(t->left); …

Member Avatar for harde_1
0
442
Member Avatar for sciwizeh

Hello All, So I'm working on hand-coding a forum-like website, just for the experience, and I want to have a similar feature as you'll see above where a thread will have its ancestors linked: "Web Development > JSP > Parent traversal of tree-like Structure" I have several beans for different …

Member Avatar for sciwizeh
0
273
Member Avatar for Dorar

Hi This code not run : it show this error: incompatible types-found java.lang.String but expected HuffmanCodingAnimation.Node This line of code ` root.left.code = root.code + "0";` Here is the code: import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.tree.*; /* * This program enables a user to enter text and displays …

Member Avatar for JamesCherrill
1
649
Member Avatar for coolbeanbob

Hi Everyone, I am trying to get the program below to work correctly. The line below is where I'm having trouble. (line 33 in PrefixCalc.java) calc = new ExpressionTree(new Scanner(console.nextLine())); When I run the program and enter "4 + 8", the scanner only picks up "4". Apparently this program was …

Member Avatar for deceptikon
0
335
Member Avatar for tumblinmonkeym

I have to write a program that creates a binary search tree from a file and output it and several other requirements. One requirement that I cannot figure out is how to find the search cost for each node. These are the instructions I was given Calculate the search cost …

Member Avatar for gusano79
0
651
Member Avatar for tiffany.leroux.7

I am doing huffman coding and I have made the tree. Now I am required to traverse the tree to create bit strings associated with the characters. Then I will put the bit string and char into a map to use with encode/decode. I have been working on this for …

Member Avatar for owenransen
0
456
Member Avatar for next_tech

Hi Guys, I am working on a binary search tree and I've been stuck on some code for the last couple of days. There are 2 issues that I can't seem to figure out how to fix. 1) I have a file that has a list of names and ID's …

Member Avatar for bguild
0
409
Member Avatar for Alkajak

class BTNode(object): """A node in a binary tree.""" def __init__(self, item, left=None, right=None): """(BTNode, object, BTNode, BTNode) -> NoneType Initialize this node to store item and have children left and right, as well as depth 0. """ self.item = item self.left = left self.right = right self.depth = 0 # …

Member Avatar for dashing.adamhughes
0
262
Member Avatar for dreday92

I am having an issue implementing the Breadth First Search, Im trying to find the shortest distance between the source city and the destination city. Here is what I have so far, Im stuck and dont know what to do about this issue. #include <iostream> #include <string> #include <fstream> #include …

Member Avatar for dreday92
0
218
Member Avatar for wschamps42

Hey guys, can anyone tell me how I could use randomaccessfile to read in a txt file and copy the content to a tree? Also how to then do the opposite and write newly changed nodes from the tree onto the text file? It's pretty much like creating a save …

Member Avatar for bguild
0
268
Member Avatar for ibthevivin

Quick question. I'm studying for my CCNA and my supervisor gave me this challenge question. You're given 5x Cisco 3560's and 5x Cisco 3750's which are to be installed side-by-side on a rack. Which model would you choose to avoid issues with STP? I'm currently skimming over [this](http://www.cisco.com/en/US/prod/collateral/switches/ps5718/ps6406/data_sheet_c78-584733.pdf). Thanks!!

Member Avatar for ibthevivin
0
213
Member Avatar for RozenKristal

I got a java test done and somehow my answer for this question is incorrect, can you guys help me explain it? So the question is: in a binary tree with height 3 the least deep leaf has depth 2 (Root has depth 0). a)Max numbers of nodes this tree …

Member Avatar for RozenKristal
0
296
Member Avatar for hous3aholik

Hi! Lets say i have this expression I10I20I-3++ which should give me 27. I just cant seem to find a way of removing those I's or if it is any other letter from the string. Not forgetting i have to then evaluate the expression. I tried using regex but no …

Member Avatar for csk19
0
163
Member Avatar for hitro456

Hi All, I have a binary search tree (consider following structure). struct bst { void *value; struct bst *left, *right; }; I want to save this unbalanced binary search tree in a file. And when I read this file, I don't want to recreate the tree from these nodes. So …

Member Avatar for rubberman
0
607
Member Avatar for MiTiM

I want to create binary tree. With this program I wrote I have some problems. It seems the element I added to the tree is always added to the root place! Adding never happens to the left or the right subtree. This thing is prooved by result I always get …

Member Avatar for MiTiM
0
308
Member Avatar for fyra

Hi people. I have a remove function that should set a hide member of a node to 1 instead of actually remove the node. The function works well when I insert and remove top and tap respectively (both nodes have their hide member set to 1) but when I insert …

0
155
Member Avatar for fyra

Hi everyone. I'm tying to understand the instruction below. I wish someone could explain me what it means: tree->destroy(((AvlNode*)(*position)->data)->data); // destroy the left branch of the binary search tree starting from the specified node static void destroy_left(BisTree* tree, BiTreeNode* node) { BiTreeNode **position; // can't remove from an empty tree …

Member Avatar for Nutster
0
372
Member Avatar for gtkesh

Hello everybody. Here is my remove method for bst. As you all know, there are 3 cases to consider while removing a node from bst. For the last case, when a node (which is to be removed) has 2 children, I want to use predecessor instead of successor to change …

0
121
Member Avatar for nitin1

#include<iostream> #include<algorithm> using namespace std; #define MAX 10000000 #include<stdlib.h> #include<string.h> char s[MAX]; int p[MAX]; int bucket[MAX],nbucket[MAX]; struct suffix { int idx; }pos[MAX]; int H=0; bool cmp(struct suffix i,struct suffix j) { if(H==0) { return s[i.idx]<s[j.idx]; } else { if(bucket[i.idx]==bucket[j.idx]) { return bucket[i.idx+H]<bucket[j.idx+H]; } else { return bucket[i.idx]<bucket[j.idx]; } } } …

Member Avatar for deceptikon
0
615
Member Avatar for deepecstasy

Here is my splay function: template <class WA> void SplayTree<WA>::Do_Splay(SplayNODE<WA> *temp) //temp is the node which is to be splayed { if (temp==root) //if temp is root then { return; } //Do Nothing else if (root->left==temp || root->right==temp) //else if temp is a child of root { if (root->left==temp) //if …

0
83
Member Avatar for bguild

I have been struggling with the principles of creating a client-server design where the server maintains a data structure that multiple clients can view and manipulate with various restrictions on which client can access which parts of the structure. I don't know what to properly call a system like that, …

Member Avatar for bguild
1
1K

The End.