Re: A weird requirement - unable to think of anything...
- From: "Phlip" <phlipcpp@xxxxxxxxx>
- Date: Sat, 13 Oct 2007 23:35:59 -0700
Legend wrote:
Thank you... Incase I want to construct a double linked list for this
data, how would I be doing that? Consider each vertex as an element or
each number as one element?
Again: This is prior-art for graph theory, so look it up.
Briefly, saying "1 is connected to 3" could appear in an "adjacency matrix",
like this:
1 2 3
1 - - *
2 - - *
3 * * -
You could program that as a sparse matrix, or as a real matrix in a 2D
array.
However, the algorithm you select will determine the data representation,
not the other awy around. That is the point of any algorithm - converting a
problem into an expression of the solution, so you can then pull the
solution out of the expression.
--
Phlip
.
- References:
- Prev by Date: Re: A weird requirement - unable to think of anything...
- Next by Date: Re: A weird requirement - unable to think of anything...
- Previous by thread: Re: A weird requirement - unable to think of anything...
- Next by thread: Re: A weird requirement - unable to think of anything...
- Index(es):
Relevant Pages
|