You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. You need 2 indexes to keep track of your progress for the two arrays while merging.
116
+
117
+
2. This is the merged array. It's empty right now, but you'll build it up in subsequent steps by appending elements from the other arrays.
118
+
119
+
3. This while loop will compare the elements from the left and right sides to make sure that the result stays in order.
120
+
121
+
4. If control exits from the previous while loop, it means that either `leftPile` or `rightPile` has it's contents completely merged into the `orderedPile`. At this point, you no longer need to do comparisons. Just append the rest of the contents of the other array until there's no more to append.
0 commit comments