I having a problem of representing my tree. Please help!!
Let look at a graph
0----1---
| |----4----5
2----3---
1 connect to 4, 4 connect to 5
3 connect to 4, 4 connect to 5
If we represent this to a tree with 0 is the root then
0. 1 2
1. 4
2. 3
3. 4
4. 5
1 and 2 are the children of 0. 4 is ...
Search found 9 matches
- Sat Oct 04, 2008 3:57 am
- Forum: Algorithms
- Topic: Dynamic Programming -- Independent sets in tree
- Replies: 1
- Views: 1678
- Fri Sep 08, 2006 9:54 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10000 - Longest Paths
- Replies: 160
- Views: 56526
10000 WA!!! Help please!!!!
I look at all the sample output that all users have posted, and my code passed them all. However I still got wrong answer... help please....
#include<iostream>
using namespace std;
int main(){
class AdjListNode{
public:
AdjListNode *next;
int vert;
AdjListNode(int v, AdjListNode *ne){
vert ...
#include<iostream>
using namespace std;
int main(){
class AdjListNode{
public:
AdjListNode *next;
int vert;
AdjListNode(int v, AdjListNode *ne){
vert ...
- Thu Sep 29, 2005 9:10 pm
- Forum: Volume 1 (100-199)
- Topic: 111 - History Grading
- Replies: 135
- Views: 37044
- Thu Sep 29, 2005 8:54 pm
- Forum: Other words
- Topic: Which problems use dynamics programming algorithm?
- Replies: 2
- Views: 4757
- Wed Sep 28, 2005 7:15 pm
- Forum: Other words
- Topic: Which problems use dynamics programming algorithm?
- Replies: 2
- Views: 4757
Which problems use dynamics programming algorithm?
Can anyone tell me which problems used dynamics programming to solve? I know 111 is one of them. Any other sugesst? Thanks
- Mon Sep 26, 2005 5:38 am
- Forum: Volume 1 (100-199)
- Topic: 111 - History Grading
- Replies: 135
- Views: 37044
111!!! Run time error!!! Help please
I got run time error for this problem even though I got all the right answer. Help please
Here is my code:
using namespace std;
int longest[20];
int number[20];
int key[20];
int answer[20];
int subscript[20];
void FixOrder(int n, int x[]);
int LCS(int n);
void Clean(int n);
int main(){
int n,k,m ...
Here is my code:
using namespace std;
int longest[20];
int number[20];
int key[20];
int answer[20];
int subscript[20];
void FixOrder(int n, int x[]);
int LCS(int n);
void Clean(int n);
int main(){
int n,k,m ...
- Mon Sep 12, 2005 7:12 pm
- Forum: Volume 7 (700-799)
- Topic: 729 - The Hamming Distance Problem
- Replies: 54
- Views: 21443
- Fri Sep 09, 2005 9:29 pm
- Forum: Volume 7 (700-799)
- Topic: 729 - The Hamming Distance Problem
- Replies: 54
- Views: 21443
- Mon Jan 31, 2005 8:14 pm
- Forum: Volume 7 (700-799)
- Topic: 707 - Robbery
- Replies: 12
- Views: 8065
707 "Robbery"
I'm very sorry but I have a severals questions about problems. First what is L, T, R,B? I know that they are left, top, right, bottom. But left, right... to what? The problem said that the town is in rectangular shape, and the top left corner is(1,1) and the bottom right corner is (W,H). So go back ...