Skip to content

adding stack and queue code infrastructure #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions book.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
"lang": "kotlin",
"name": "Kotlin"
},
{
"lang": "ts",
"name": "TypeScript"
},
{
"lang": "vim",
"name": "VimL"
Expand Down
14 changes: 14 additions & 0 deletions contents/stacks_and_queues/stacks_and_queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ For the most part, though, queues and stacks are treated the same way. There mus

The notation for this depends on the language you are using. Queues, for example, will often use `dequeue()` instead of `pop()` and `front()` instead of `top()`. You will see the language-specific details in the source code under the algorithms in this book, so for now it's simply important to know what stacks and queues are and how to access elements held within them.

## Example Code
Here is a simple implementation of a stack:
{% method %}
{% sample lang="ts" %}
[import, lang:"typescript"](code/typescript/stack.ts)
{% endmethod %}

Here is a simple implementation of a queue:
{% method %}
{% sample lang="ts" %}
[import, lang:"typescript"](code/typescript/queue.ts)
{% endmethod %}


## License

##### Code Examples
Expand Down