Examples with ascending order
E.g. Move D to B (no room for any)
Start:
id | order |
---|---|
A | 1 |
B | 2 |
C | 3 |
D | 4 |
E | 45 |
End:
id | order |
---|---|
A | 1 |
D | 2 |
B | 3 |
C | 4 |
E | 45 |
Request:
{
"D": 2,
"B": 3,
"C": 4
}
E.g. Move D to B (room available)
Start:
id | order |
---|---|
A | 1 |
B | 20 |
C | 30 |
D | 40 |
E | 45 |
End:
id | order |
---|---|
A | 1 |
D | 10 |
B | 20 |
C | 30 |
E | 45 |
Request:
{
"D": 10
}
E.g. Move E to A (some room available)
Start:
id | order |
---|---|
A | 1 |
B | 2 |
C | 20 |
D | 40 |
E | 45 |
End:
id | order |
---|---|
E | 1 |
A | 2 |
B | 10 |
C | 20 |
D | 40 |
Request: (note I didn't have to send C or D)
{
"E": 1,
"A": 2,
"B": 10
}