Skip to content

Instantly share code, notes, and snippets.

@frankgx97
Created June 16, 2019 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankgx97/63de78420e2aae98a82a27f53b8108cb to your computer and use it in GitHub Desktop.
Save frankgx97/63de78420e2aae98a82a27f53b8108cb to your computer and use it in GitHub Desktop.
========Iteration: 0 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-2]
max: 4
========Iteration: 1 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-2, -1]
max: 4
========Iteration: 2 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4]
max: 4
========Iteration: 3 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, 0]
max: 4
========Iteration: 4 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -1]
max: 4
========Iteration: 5 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -1, 1]
max: 5
========Iteration: 6 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -1, 1, 2]
max: 6
========Iteration: 7 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -3]
max: 6
========Iteration: 8 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -3, 1]
max: 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment