Conversation
Created a tutorial meant to describe the basics of stacks.
panbed
reviewed
Aug 6, 2024
Contributor
panbed
left a comment
There was a problem hiding this comment.
Very preliminary review, I'm still at work so I can't really deep dive into the content yet but this review is just to address a few small issues and maybe some new content that could be added.
|
|
||
| # What is a Stack? | ||
|
|
||
| According to Don Knuth, a stack is "a linear list for which all insertions and deletions are made at one end of the list." The quote illustrates the `Last in First Out` principle (LIFO) which all stacks follow. The last item placed in the stack will be the first item to be removed. |
Contributor
There was a problem hiding this comment.
Maybe a "real world" example of a stack might be helpful? For instance I've always liked the analogy to a "stack" of paper, e.g. "pushing" to a stack is like adding another paper to your "stack" of paper, "popping" is removing it from the top, etc.
Contributor
Author
There was a problem hiding this comment.
That's a good idea. Wasn't sure which example to use, but paper or plates should work.
Co-authored-by: Bed Pandey <bed.dev.p@gmail.com>
Co-authored-by: Bed Pandey <bed.dev.p@gmail.com>
Co-authored-by: Bed Pandey <bed.dev.p@gmail.com>
Co-authored-by: Bed Pandey <bed.dev.p@gmail.com>
Co-authored-by: Bed Pandey <bed.dev.p@gmail.com>
Co-authored-by: Bed Pandey <bed.dev.p@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created a short tutorial on stacks.