Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: programming Pin
Hamid_RT12-Oct-06 6:37
Hamid_RT12-Oct-06 6:37 
AnswerRe: programming Pin
Hamid_RT12-Oct-06 6:39
Hamid_RT12-Oct-06 6:39 
GeneralRe: programming Pin
led mike12-Oct-06 8:12
led mike12-Oct-06 8:12 
GeneralRe: programming Pin
Hamid_RT12-Oct-06 19:48
Hamid_RT12-Oct-06 19:48 
AnswerRe: programming Pin
Mark Salsbery12-Oct-06 10:02
Mark Salsbery12-Oct-06 10:02 
GeneralRe: programming Pin
Christian Graus12-Oct-06 10:11
protectorChristian Graus12-Oct-06 10:11 
GeneralRe: programming Pin
Mark Salsbery12-Oct-06 10:26
Mark Salsbery12-Oct-06 10:26 
QuestionConstructing a tree Pin
llp00na12-Oct-06 4:25
llp00na12-Oct-06 4:25 
Dear everyone;

I have got a pure C++/ algorithmic question that i would appreciate your input towards.

I have a number of files (lets say 100 files) of similar input formats. To reduce the complexity of the problem I will give you a simplied example:

File 1: File 2: File 3:
A A B
B E A
C D D
D D F
E F E

I want to write a program which produces a tree from the files, in which the first node is the node from the first line (from above) with the highest number of occurences ('A' in this case). Consequently File 3 will be ignored.

The resulting tree will be something like
A (100%)
B (50%) E (50%)
C (50%) D (50%)
D (100%)
E (50%) E (50%)

SO basically the program should go through the files and construct a tree with a % value of each node. every time branching occurs the % will be divided depending on the number of children.

My question is, is there any specific algorithm / similar algorithms which i can use to overcome this problem ? and What's the best way to visualise the tree?

Your help is very much appreciated
Best Regards



llp00na

QuestionRe: Constructing a tree Pin
David Crow12-Oct-06 5:56
David Crow12-Oct-06 5:56 
Questionrepresent string as its DWORD value Pin
Makakuin12-Oct-06 3:37
Makakuin12-Oct-06 3:37 
AnswerRe: represent string as its DWORD value Pin
Mark Salsbery12-Oct-06 4:48
Mark Salsbery12-Oct-06 4:48 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 7:20
Makakuin12-Oct-06 7:20 
GeneralRe: represent string as its DWORD value Pin
Mark Salsbery12-Oct-06 7:43
Mark Salsbery12-Oct-06 7:43 
AnswerRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 7:24
Zac Howland12-Oct-06 7:24 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 7:41
Makakuin12-Oct-06 7:41 
GeneralRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 7:56
Zac Howland12-Oct-06 7:56 
GeneralRe: represent string as its DWORD value [modified] Pin
Makakuin12-Oct-06 9:09
Makakuin12-Oct-06 9:09 
GeneralRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 9:16
Zac Howland12-Oct-06 9:16 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 10:00
Makakuin12-Oct-06 10:00 
GeneralRe: represent string as its DWORD value Pin
Zac Howland12-Oct-06 10:03
Zac Howland12-Oct-06 10:03 
GeneralRe: represent string as its DWORD value Pin
Makakuin12-Oct-06 9:28
Makakuin12-Oct-06 9:28 
QuestionRe: represent string as its DWORD value Pin
David Crow12-Oct-06 9:34
David Crow12-Oct-06 9:34 
QuestionResource.h File Checking Pin
Andy20212-Oct-06 3:12
Andy20212-Oct-06 3:12 
AnswerRe: Resource.h File Checking Pin
Hamid_RT12-Oct-06 3:20
Hamid_RT12-Oct-06 3:20 
GeneralRe: Resource.h File Checking Pin
David Crow12-Oct-06 3:50
David Crow12-Oct-06 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.