I thought a lot about this, but could not think of anything.
Suppose I want X n to collect items sorted by any column and any row under O (m * n), as well as the ability to insert or delete a row in O (m + n) or less ... is this possible?
What I came up with is a linked grid where the nodes are inserted into the vector, so I have indexes for them and the first row and column are indexed to remove the need to go through the list in any direction, with my method I achieved the above complexity, but I had itβs just interesting if this can be further reduced with the help of a variable factor.
Sort example:
1 100 25 34
2 20 15 16
3 165 1 27
Sorted by 3rd row:
25 1 34 100
15 2 16 20
1 3 27 165
Sort THAT by 1st column:
1 3 27 165
15 2 16 20
25 1 34 100