Search:
Type: Posts; User: SlickHawk
Search:
Search took 0.01 seconds.

Well, normally, to find the depth of a tree, we do something like this:
int GetDepth(Node * node)
{
//this example doesn't take into account trees with just one child
//but that's...

That's a big problem. That assignment is simply copying the pointer to the string, which, as we can find by travelling up the stack, is just data's value. That array is getting overwritten every...

April 25th, 2009, 03:03 PM
What you're looking for is a dictionarybased encoding scheme. The word "dictionary" alone should provide you ample avenues if you search, but "LZW" might be a good starting place.

April 25th, 2009, 08:29 AM
I'm not quite sure what you're asking. If it's about C++ syntax for referencing functions, this isn't really the forum for that, but whatever.
So, from what I've gathered, you need to make your...

April 21st, 2009, 12:08 AM
Edit: Ah, wait, I think I just now understood.
Actually, it may be a conversion to HSV and back for each iteration. I'm not sure the properties of something like that, but it seems likely.

April 16th, 2009, 02:50 PM
In order to start thinking about an algorithm, we'd need some more information.
Is the cost of splitting the same no matter what? For example...
Cost(splitting 10 into 5,5) == Cost(splitting...

April 13th, 2009, 09:12 AM
If you have preorder and inorder, you should be able to do postorder. They're just swapping the orders in which you do things.
preorder:
1. visit node
2. preorder(node.left)
3....

April 13th, 2009, 09:07 AM
From what I can see, your BFS looks correct.
The difference between a BFS and a DFS is very minimal. A BFS algorithm looks something like this:
1. Place the starting node on a list.
2. If the...

April 11th, 2009, 09:54 PM
For a valid binary tree, an inorder traversal will always result in a strictly nondescending order, so yours is correct.
In a postorder traversal, you visit both your children before you visit...

April 11th, 2009, 02:42 AM
Ah, I see what the problem is then. I realize I was incorrect before, there may be several unique subsequences of length L. For example,
1, 3, 2, 5
(1, 2, 5) and (1, 3, 5) are both valid...

April 10th, 2009, 10:47 AM
Well, if you have an algorithm to find the longest increasing subsequence (which is already O(n*lg(n))), and it turns out that the size of the subsequence returned is >= L, then any possible...

April 9th, 2009, 06:04 AM
We need more information than that. What do you mean, "in linked lists"? Does each node contain information about a different degree in the polynomial? Are you guaranteed the variable is always...

April 8th, 2009, 05:10 PM
Ah, you're right. So, to rectify, any time C is a destination, that may also fill one of the required "source" C's, meaning that a node X should appear in the list max(source X's, dest X's) times. ...

April 8th, 2009, 06:21 AM
Could you explain how they're not equivalent problems? That's not meant to be snide; I'd truly like to know.
To me, just thinking about it, it's just TSP on a subset of G, where G is the initial...

April 7th, 2009, 12:58 AM
Run Dijkstra's from A>D>F>H.
And then again from A>F>D>H.
See which one has a smaller cost.

April 6th, 2009, 08:35 AM
I'm having trouble understanding exactly what you want to achieve here. Do you think you could list the logical sequence of events you're aiming for? Then I might be able to help you.

April 6th, 2009, 08:27 AM
That's the Travelling Salesman problem, which is NPComplete. You won't find a nonprobabilistic algorithm that's better than O(k^N) because none has been found.

April 6th, 2009, 07:53 AM
Off the top of my head...
Rework your dictionary such that each word is keyed by its spelling in alphabetical order. That is:
APPLE becomes AELPP
BRILLIANT becomes ABIILLNRT
Then you...

March 31st, 2009, 03:47 PM
I'm trying to implement a fibonacci heap, and I'm running into some troubles when trying to implement delete_node.
When implementing delete_min, I was assured that the size of the array necessary...

Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.
Featured
