Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/anthoruiz/algorithmdatastructure


https://github.com/anthoruiz/algorithmdatastructure

Last synced: 13 days ago
JSON representation

Awesome Lists containing this project

README

        


Amazon Logo


Data Structure and FAANG Exercises using Python


## Array, String, HashMap
- Check String Array is Unique [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/CheckArray.py)
- Group Anagrams **(Leetcode #49)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/GroupAnagrams.py)
- Two Sum **(Leetcode #1)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/TwoSum.py)
- Set Matrix Zeroes **(Leetcode #73)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/SetMatrixZeroes.py)
- Reverse String **(Leetcode #344)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/ReverseArray.py)
- Palindrome **(Leetcode #125)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/Palindrome.py)
- Reverse Integer **(Leetcode #7)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/ReverseInteger.py)
- Valid Anagram **(Leetcode #242)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/Anagram.py)
- PlusOne **(Leetcode #66)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/PlusOne.py)
- Climbing Stairs **(Leetcode #70)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/ClimbingStairs.py)
- Find the Index of the First Occurrence in a String **(Leetcode #28)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/NeedleHaystack.py)
- Kth Distinct String in an Array **(Leetcode #2053)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/KthDistinct.py)
- String Compression **(Leetcode #443)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/StringCompression.py)
- Move Zeroes **(Leetcode #443)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/MoveZeroes.py)
- Buddy String **(Leetcode #443)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/BuddyStrings.py)
- Longest Common Subsequence (P.D)**(Leetcode #1143)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/LongestCommonSubsequence.py)
- Coin Change (P.D)**(Leetcode #322)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/CoinChange.py)
- HouseRobber (P.D)**(Leetcode #198)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/HouseRobber.py)
- Fibonacci and Tribonacci **(Leetcode #1137, #509)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/Fibonacci.py)
- Best Time to Buy and Sell Stock (Sliding Window) **(Leetcode #121)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/MaxProfit.py)
- Isomorphic Strings **(Leetcode #205)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/IsomorphicStrings.py)
- Word Pattern **(Leetcode #290)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/WordPattern.py)
- Roman to Int, Int to Roman **(Leetcode #13, #12)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/RomanToInteger.py)
- Concatenated Words **(Leetcode #472)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/ConcatenatedWords.py)
- Word Break **(Leetcode #139)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/WordBreak.py)
- Concatenation Of Array **(Leetcode #1929)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/ConcatenationOfArray.py)
- Remove Element **(Leetcode #27)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/RemoveElement.py)
- Is Subsequence **(Leetcode #392)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/IsSubsequence.py)
- Counting Bits **(Leetcode #338)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/CountingBits.py)
- Length Of Last Word **(Leetcode #58)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/LengthofLastWord.py)
- Min Cost Climbing Stairs **(Leetcode #746)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/MinCostClimbingStairs.py)
- Single Number **(Leetcode #136)** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/SingleNumber.py)
- Pascal Triangle **(Leetcode #118 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/PascalTriangle.py)
- Merge Sorted Array **(Leetcode #88 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/MergeSortedArray.py)
- Majority Element **(Leetcode #169 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/MajorityElement.py)
- Contains Duplicate **(Leetcode #217 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/ContainsDuplicate.py)
- Island Perimeter **(Leetcode #463 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/IslandPerimeter.py)
- Flood Fill **(Leetcode #733 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/FloodFill.py)
- Remove DuplicatesArray **(Leetcode #26 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/RemoveDuplicatesArray.py)
- Happy Number **(Leetcode #202 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/IsHappy.py)
- Summary Ranges **(Leetcode #228 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/ArraysStringsHashTables/SummaryRanges.py)

(back to top)

## Linked List, Doubly Linked List, Stacks and Queues
- Linked List Implementation [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/LinkedLists/LinkedList.py)
- **This Implementation contains the follow features**:
- insert_start() → **O(1)**
- insert_end() → **O(N)**
- traverse() → **O(N)**
- remove_first → **O(1)**
- remove_end → **O(N)**
- remove(element_to_remove) → **O(N)**
- insert_at(element, index) → **O(N)**
- reverse() → **O(N)**
- reverse_between() **(Leetcode #92 )**
- get_middle_node() → **O(N)**

(back to top)

- Doubly Linked List Implementation [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/DoublyLinkedList/DoublyLinkedList.py)
- This Implementation contains the follow features:
- traverse_forward() → **O(N)**
- traverse_backward() → **O(N)**
- insert_end() → **O(1)**
- insert_start() → **O(1)**

(back to top)

- Stack Implementation Using Array [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/StackQueue/Stack.py)
- Queue Implementation Using Array [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/StackQueue/Queue.py)
- Get MaxValue of a Stack using an auxiliary stack [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/StackQueue/MaxStack.py)

(back to top)

## Binary Search Tree (BST), AVL Tree, Red-Black Tree and Heaps
- BST [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/BinarySearchTree/BinarySearchTree.py)
- This Implementation contains the follow features:
- insert → **O(long(N))**
- remove → **O(H) H is the Height of the tree**
- get_max → **O(long(N))**
- get_min → **O(long(N))**
- in_order() → **O(N)**
- pre_order() → **O(N)**
- post_order() → **O(N)**
- is_valid_BST **(Leetcode #98 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/BinarySearchTree/BinarySearchTree.py#L154)
- Same Tree **(Leetcode #100 )** [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/BinarySearchTree/TreeComparator.py)

- AVL Tree [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/BinarySearchTree/AVLTree.py)
- This Implementation contains the follow features:
- insert()
- remove()
- in_order()

- Red Black Tree [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/BinarySearchTree/RedBlackTree.py)
- This Implementation contains the follow features:
- insert()
- in_order()

- Heap [here](https://github.com/AnthoRuiz/AlgorithmDataStructure/blob/main/BinarySearchTree/Heap.py)
- This Implementation contains the follow features:
- insert()
- get_max()
- poll()
- heap_sort()
- check_max_heap()

(back to top)

This project is licensed under the terms of the **MIT** license