tree structure?

A

Adalbert

First, I'm sorry for my english.
Second, I've a little question: is some tree stucture like collections
ArrayList or Queue to hold tree of same objects in .NET? Maybe I can use
TreeView to that. I must hold tree of Halma's game (like checkers), which I
generate with minimax algorithm.
Hmm, is it good in english? :) I hope :)

Thanks for all answers.
 
R

Robert Jacobson

Hi Adalbert,

Very good English. :)

There isn't a built-in framework class for a tree data structure. It might
be possible to use the TreeView if you have to, but it's designed for
displaying data in tree form. It will be very inefficient if you just use
it to store data.

Noramlly, people just build their own TreeNode class. If you're working in
C#, there's a good overview here:

http://www.brpreiss.com/books/opus6/

If you're working in VB, there a great book by Rod Stephens, "Ready-to-Run
Visual Basic Algorithms, 2nd Edition," that includes several chapters on how
to build and use tree data structures. (It includes an example of how to
use a decision tree for the game of Tic-Tac-Toe, which might be similar to
what you're trying to accomplish.) The book was written for Visual Basic 6,
but the general principles apply to any language, including VB.Net and C#.

Hope this helps.

--Robert Jacobson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top