Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/juliogarciape/data-structures-and-algorithms

<Data Structures and Algorithms with Python />
https://github.com/juliogarciape/data-structures-and-algorithms

algorithms data-structures data-structures-and-algorithms python python3

Last synced: about 1 month ago
JSON representation

<Data Structures and Algorithms with Python />

Awesome Lists containing this project

README

        

# Data Structures and Algorithms (Python)

## Data Structures

#### Stack:

```python
# ---- Basic Example ----

my_stack = Stack() # Initialize a stack
print(my_stack.is_empty())
my_stack.push("Book A") # Add to stack
my_stack.push("Book B")
print(my_stack.get_stack()) # Get the stack
my_stack.push("Book C")
print(my_stack.get_stack())
my_stack.pop() # Remove last addition from stack
print(my_stack.get_stack())
print(my_stack.is_empty()) # Get if stack is empty
print(my_stack.peek()) # Get last addition from stack
```

### Use cases for stack:

- Determine if the brackets are unbalanced
- Reverse String
- Convert Integer to Binary