# Project: Stacks and Queues

## Introduction

This exercise will be a small one to give you an appreciation of how `queues` and `stacks` work. Of course, a great way to figure out how anything works is to make the thing yourself, so this is what we will be doing in this lesson. This is mostly an academic exercise, so you will be asked to refrain from using `queue-like` or `stack-like` methods in your solution, however tempting this otherwise sensible choice would be.

## Assignment

In your language of choice...

1. Create a "Stack" class, which will have a private array member variable, and two public methods '#push(item)' and '#pop'. Push should add item to the end of your array, and pop should remove from the end.
   * If you're using Ruby, Javascript or similar languages, please try and do this without using the array's push and pop methods for this exercise!
2. Create a "Queue" class, which will have a private array member variable, and two public methods '#enqueue(item)' and '#dequeue'. Enqueue should add item to one end of the array, and Dequeue should remove from the other end.
   * Like with "Stack", please refrain from using 'push' and 'shift' if you're using a language that has these (or similar) methods!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://howtocode.trek.io/topics/deep-dives/computer-science/data-structures/project-stacks-and-queues.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
