I've searched the forum, and tried to implement the code in the threads I found. But I've been working on this real simple program since about 10am, and can't solve the seg. faults for the life of me.
Any ideas on what I'm doing wrong would be greatly appreciated.
BST.h (All the implementation problems should be in here.)
#ifndef BST_H_
#define…
Has anyone had the experience of moving a file in tortoise and committing successfully, only to later commit a different change and be told of a tree conflict where:
the file in its original location has been deleted, but in tortoise is marked as missing
the file in its new location is there, but marked as already added.
(I use tortoise SVN,…
Hi,
If we are looking for line intersections (horizontal and vertical lines only) and we have n lines with half of them vertical and no intersections then
Sorting the list of line end points on y value will take N log N using mergesort
Each insert delete and search of our data structue (assuming its a b-tree) will be < log n
so the…
I am planning to implement a tree structure where every node has two children and a parent along with various other node properties (and I'd want to do this in Java )
Now, the way to it probably is to create the node such that it links to other nodes ( linked list trick ), but I was wondering if there is any good external library to handle…
In playing around with C#'s Speech Recognition, I've stumbled across a road block in the creation of an effective GrammerBuilder with Choices (more specifically, Choices of Choices).
IE considering the following logical commands.
One solution would to "hard code" every combination of Speech lines and add them to a GrammarBuilder (ie…
I have a response from remote server like this:
/home/computer/Downloads
|-- /home/computer/Downloads/Apple
| `-- /home/computer/Downloads/Apple/Pad
|-- /home/computer/Downloads/Empty_Folder
`-- /home/computer/Downloads/Subfolder
|-- /home/computer/Downloads/Subfolder/Empty
`-- /home/computer/Downloads/Subfolder/SubSubFolder
…
I'm looking for a well-documented, supported WPF component that provides an API for visualisation of 2D tree diagrams. Ideally something easy to use, customisable (i.e. supports various flavours of nodes and splines) and preferably with automated layout control.
Tools that look good so far are GoXam…
So this is my first java program, but I've done c++ for a few years. I wrote what I think should work, but in fact it does not. So I had a stipulation of having to write a method for this call:
tree.insertNode(value);
where value is an int.
I wanted to write it recursively, for obvious reasons, so…
Hi guys,
I'm working on a fun project where I need a simple key/value store that uses B+Trees. I studied them some years ago, and to be honest, I don't want to reinvent the wheel, so I'm looking for a simple implementation in C of b+tree that I can just include in my project.
I know of sqlite's,…
Hi Everybody,
I have a question concerning Tree items. I want to show where a drop action would be placed... The item will be placed in between two existing elements. So what I want to do is, to take the upper item and draw a line underneath it. But I struggling to address the itemRenderer...
I…
In a binary search tree that takes a simple object.....when creating the getter and setter methods for the left, right, and parent. do I a do a null pointer? as in this=this or do I create the object in each method? Code bellow...
This is my code:
public void setParent(Person parent) {
…
I have reduced my problem to finding the minimal spanning tree in the graph. But I want to have one more constraint which is that the total degree for each vertex shouldnt exceed a certain constant factor. How do I model my problem? Is MST the wrong path? Do you know any algorithms that will…
Hi,
I need to find out how many even values are contained in a binary tree.
this is my code.
private int countEven(BSTNode root){
if ((root == null)|| (root.value%2==1))
return 0;
return 1+ countEven(root.left) + countEven(root.right);
}
this i just coded as i do not have a way to…
Hi everyone, I am experiencing a problem that has popped up recently and is causing quite a bit of trouble for our system.
The app we have relies on using the movedown method to organize content, but as of late it has stopped working and began to generate the following warning:
Warning…
I am trying to generate a syntax tree, for a given string with simple math operators (+, -, *, /, and parenthesis).
Given the string "1 + 2 * 3":
It should return an array like this:
["+",
[1,
["*",
[2,3]
]
]
]
I made a function to transform "1 + 2 * 3" in [1,"+",2,"*",3].…
We're learning B-trees in class and have been asked to implement them in code. The teacher has left choice of programming language to us and I want to try and do it in C#. My problem is that the following structure is illegal in C#,
unsafe struct BtreeNode
{
int…
I want to create Ext.tree.TreePanel component and periodically load content from the external URl. So I've written something like
new Ext.tree.TreePanel({
root: {
nodeType: 'async',
text: 'asdasd',
draggable: false,
id: 'folders-tree-root'
},
…
I'm quite new to C and I'm trying to implement a Binary Tree in C which will store a number and a string and then print them off e.g.
1 : Bread
2 : WashingUpLiquid
etc.
The code I have so far is:
#include <stdio.h>
#include <stdlib.h>
#define LENGTH 300
struct node…
Given a tree, I want to find the paths from the root to each leaf.
So, for this tree:
D
/
B
/ \
A E
\
C-F-G
has the following paths from root (A) to leaves (D, E, G):
(A B D), (A B E), (A C F G)
If I represent the tree above as (A (B D E) (C (F G))) then the…
I am adding new operator overloads to take advantage of c++0x rvalue references, and I feel like I'm producing a lot of redundant code.
I have a class, tree, that holds a tree of algebraic operations on double values. Here is an example use case:
tree x = 1.23;
tree y = 8.19;…