blossom-babs / Data-structures-and-algorithm

Data structures and algorithms solutions in javascript and pythong - arrays, linked list, trees, lists, object oriented programming
https://github.com/blossom-babs/Data-structures-and-algorithm
12 stars 5 forks source link
algorithm algorithms data-structures javascript jest-tests leetcode

Data structure and algorithms

Exercising my problem solving skills by solving coding challenges and optimizing my result for best solution with data structures and complexity analysis.

Find solutions here

Solutions to Sean Prashad Pattern curated list

No LC Index Question Python Soln Javascript soln Difficulty Tags
1 217 Contains Duplicate Solution Easy Array, Hash Table, Sorting
2 268 Missing Number Solution Easy Array, Hash Table, Math, Sorting, Binary search, Bit Manipulation
3 448 Find All Numbers Disappeared in an Array Solution Easy Array, Hash Table
4 136 Single Number Solution Easy Array, Bit Manipulation
5 70 Climbing Stairs Solution Easy Math, Dynamic Programming, Memoization
6 121 Best Time to Buy and sell stock Solution Easy Array, Dynamic Programming
7 303 Range Sum Query Immutable Solution Easy Array, Design, Prefix Sum
8 141 Linked List Cycle Solution Easy Hash Table, Linked List, Two Pointers
9 876 Middle of the linked list Solution Easy Linked List, Two Pointers
10 234 Palindrome linked list Solution Easy Linked List, Two Pointers, Stack Recursion
11 206 Reverse linked list Solution Easy Linked List, Stack Recursion
12 203 Remove linked list Elements Solution Easy Linked List, Recursion
13 83 Remove Duplicates from sorted List Solution Easy Linked List
14 21 Merge Two sorted List Solution Easy Linked List, Recursion
15 704 Binary Search Solution Solution Easy Binary Search, Array
16 744 Find Smallest Letter Greater than Target Solution Solution Easy Binary Search, Array
17 637 Average of Levels in Binary Tree Solution Solution Easy Tree, BFS, DFS, Binary Tree
18 111 Minimum Depth of Binary Tree Solution Solution Easy Tree, BFS, DFS, Binary Tree
19 104 Maximum Depth of Binary Tree Solution Solution Easy Tree, BFS, DFS, Binary Tree
20 100 Same Tree Solution Solution Easy Tree, BFS, DFS, Binary Tree
21 112 Path Sum Solution Solution Easy Tree, BFS, DFS, Binary Tree
22 1 Two Sum Solution Solution Easy Array, Hash Table
23 226 Invert Binary Tree Solution Solution Easy Tree, BFS, DFS, Binary Tree
24 572 Subtree of another Tree Solution Solution Easy Tree, BFS, DFS, Binary Tree
25 977 Squares of a sorted array Solution Solution Easy Array, Two Pointers, Sorting
26 844 Backspace String Compare Solution Solution Easy Two Pointers, String, Stack, Simulation
27 169 Majority Element Solution Solution Easy Array, Hash table, divide and conquer, sorting, counting
Bonus 142 Linked List cycle II Solution Easy Hash Table, Linked List, Two Pointers

Chore

  1. Test linked list problem in sean prashad pattern