Resources needed: Sort 2D array "graphically"
I have a 2D array
1 2 3
4 5 6 7 8 9and want to sort it like this
Snake
1 2 3
8 9 4 7 6 5Snake (different)
1 2 3
6 5 4 7 8 9Rotated
1 4 7
2 5 8 3 6 9Wipe (diagonal)
1 3 6
2 5 8 4 7 9Well, you got it, all kinds of sorting.
Searching the interweb for ho开发者_C百科urs now. Any resources (specific language or pseudo code) on that greatly appreciated...
Suggestion: Dump all values in a 1D-array and sort there. Then define the patterns for filling using multiple for loops.
精彩评论