Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. move(fromIndex, toIndex)
  2.  
  3. move(2, 0); // [2, 0, 1, 3, 4, 5]
  4. move(1, 2); // [2, 1, 0, 3, 4, 5] (swapped 2 with 0)
  5.  
  6. move(4, 2); // [2, 1, 4, 0, 3, 5]
  7. move(3, 4); // [2, 1, 4, 3, 0, 5] (swapped 4 with 0)
  8.  
  9. move(4, 3); // [2, 1, 4, 0, 3, 5] (swapped 0 with 3)
  10.  
  11. move(5, 4); // [2, 1, 4, 0, 5, 3] (swapped 5 with 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement