sorting with pop stacks
play

Sorting with Pop Stacks Stack sorting Pop stack sorting - PowerPoint PPT Presentation

Sorting with Pop Stacks Lara Pudwell Sorting with Pop Stacks Stack sorting Pop stack sorting 1-pop-stack sortability 2-pop-stack sortability Polyominoes on a helix Lara Pudwell Width 2 Width 3 faculty.valpo.edu/lpudwell Wrapping up


  1. Sorting with Pop Stacks Lara Pudwell Sorting with Pop Stacks Stack sorting Pop stack sorting 1-pop-stack sortability 2-pop-stack sortability Polyominoes on a helix Lara Pudwell Width 2 Width 3 faculty.valpo.edu/lpudwell Wrapping up joint work with Rebecca Smith (SUNY - Brockport) Valparaiso MST Faculty Seminar March 21, 2017

  2. Sorting with Pop Stacks Lara Pudwell Stack sorting Stack sorting Pop stack sorting 1-pop-stack sortability 2-pop-stack sortability Pop stack sorting Polyominoes on a 1-pop-stack sortability helix Width 2 2-pop-stack sortability Width 3 Wrapping up Polyominoes on a helix Width 2 Width 3 Wrapping up

  3. Sorting with Pop Permutations Stacks Lara Pudwell Stack sorting Definitions Pop stack sorting 1-pop-stack sortability ◮ permutation – an ordering of the members of a set 2-pop-stack sortability Polyominoes on a ◮ S n – the set of all permutations of { 1 , 2 , . . . , n } . helix Width 2 Width 3 Wrapping up Example: S 3 = { 123 , 132 , 213 , 231 , 312 , 321 } . π = 15243

  4. Sorting with Pop Permutations Stacks Lara Pudwell Stack sorting Definitions Pop stack sorting 1-pop-stack sortability ◮ permutation – an ordering of the members of a set 2-pop-stack sortability Polyominoes on a ◮ S n – the set of all permutations of { 1 , 2 , . . . , n } . helix Width 2 Width 3 Wrapping up Example: S 3 = { 123 , 132 , 213 , 231 , 312 , 321 } . π = 15243 π = 15243 contains 132.

  5. Sorting with Pop Permutations Stacks Lara Pudwell Stack sorting Definitions Pop stack sorting 1-pop-stack sortability ◮ permutation – an ordering of the members of a set 2-pop-stack sortability Polyominoes on a ◮ S n – the set of all permutations of { 1 , 2 , . . . , n } . helix Width 2 Width 3 Wrapping up Example: S 3 = { 123 , 132 , 213 , 231 , 312 , 321 } . π = 15243 π = 15243 contains 132, but avoids 231.

  6. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 15243 Output: S (15243) = . . .

  7. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 5243 1 Output: S (15243) = . . .

  8. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 5243 Output: S (15243) = 1 . . .

  9. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 243 5 Output: S (15243) = 1 . . .

  10. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 43 2 5 Output: S (15243) = 1 . . .

  11. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 43 5 Output: S (15243) = 12 . . .

  12. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 3 4 5 Output: S (15243) = 12 . . .

  13. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 3 4 5 Output: S (15243) = 12 . . .

  14. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 15243 is 1-stack sortable. Output: S (15243) = 12345

  15. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 35142 Output: S (35142) = . . .

  16. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 5142 3 Output: S (35142) = . . .

  17. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 5142 35142 is not 1-stack sortable. Output: S (35142) = 3 . . .

  18. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 142 35142 is not 1-stack sortable. 5 Output: S (35142) = 3 . . .

  19. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 42 35142 is not 1-stack sortable. 1 5 Output: S (35142) = 3 . . .

  20. Sorting with Pop Stacks Stacks Lara Pudwell Stack Operations Stack sorting A stack is a last-in first-out data-structure with two Pop stack sorting operations: 1-pop-stack sortability 2-pop-stack sortability ◮ push – remove the first element from input and put it Polyominoes on a on the top of the stack helix Width 2 ◮ pop – remove the top element from the stack and put it Width 3 Wrapping up on the end of the output. Input: 42 35142 is not 1-stack sortable. 5 Output: S (35142) = 31 . . .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend