|
-
November 5th, 2002, 05:15 AM
#1
sort two dimensional arrays
can you please help me with a code for the fastest algorithm? My array size is [640][480]
-
November 5th, 2002, 07:44 AM
#2
what do you mean "sort"?
Sorting is an inherently one-dimensional procedure. If you want to "sort" an 2-d struct, you have to decompose it into a linear structure.
Some common ways of decomposition are:
Array[0][0], Array[0][1], Array[0][2], ... Array[0][479], Array[1][0], etc.
or
Array[0][0], Array[1][0], Array[2][0], ... Array[639][0], Array[0][1], etc.
or expanding by diagonals
Array[0][0], Array[0][1], Array[1][0], Array[0][2], Array[1][1], etc...
There are many other ways. Do you mean you want to sort as it is linearly arranged in memory?
-
November 5th, 2002, 07:47 AM
#3
or...
Are you asking to sort a collection of arrays? Then I would need to know what form of > or < you intend to invoke. Which map from an array to a real do you intend? Its not a square matrix, so some standard mathematical forms are ruled out. Dictionary ordering?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|