skarakasoglu / data-structures-and-algorithms

Solutions implemented for data structures and algorithm problems on the internet(especially in LeetCode).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LeetCode Problems

This repository contains my solutions for some LeetCode problems using C++.

1. Arrays & Hashing

  • Contains Duplicate
  • Valid Anagram
  • Two Sum
  • Group Anagrams
  • Top K Frequent Elements
  • Product of Array Except Self
  • Valid Sudoku
  • Encode and Decode Strings
  • Longest Consecutive Sequence

2. Two Pointers

  • Valid Palindrome
  • Two Sum II
  • 3Sum
  • Container with Most Water
  • Trapping Rain Water

3. Sliding Window

  • Best Time to Buy & Sell Stock
  • Longest Substring Without Repeating Characters
  • Longest Repeating Character Replacement
  • Permutation in String
  • Minimum Window Substring
  • Sliding Window Maximum

4. Stack

  • Valid Parantheses
  • Min Stack
  • Evaluate Reverse Polish Nation
  • Generate Parantheses
  • Daily Temperatures
  • Car Fleet
  • Largest Rectangle in Histogram

5. Binary Search

  • Binary Search
  • Search a 2D Matrix
  • Koko Eating Bananas
  • Search Rotated Sorted Array
  • Find Minimum in Rotated Sorted Array
  • Time Based Key-Value Store
  • Find Median of Two Sorted Arrays

6. Linked List

  • Reverse Linked List
  • Merge Two Linked Lists
  • Reorder List
  • Remove Nth Node from End of List
  • Copy List with Random Pointer
  • Add Two Numbers
  • Linked List Cycle
  • Find the Duplicate Number
  • LRU Cache
  • Merge K Sorted Lists
  • Reverse Nodes in K-Group

7. Tree

  • Invert Binary Tree
  • Maximum Depth of Binary Tree
  • Diameter of a Binary Tree
  • Balanced Binary Tree
  • Same Tree
  • Subtree of Another Tree
  • Lowest Common Ancestor of a BST
  • Binary Tree Level Order Traversal
  • Binary Tree Right Side View
  • Count Good Nodes in a Binary Tree
  • Validate Binary Search Tree
  • Kth Smallest Element in a BST
  • Construct Tree from Preorder and Inorder Traversal
  • Binary Tree Max Path Sum
  • Serialize and Deserialize Binary Tree

8. Trie

  • Implement Trie
  • Design Add and Search Word Data Structure
  • Word Search II

9. Heap / Priority Queue

  • Kth Largest Element in a Stream
  • Last Stone Weight
  • K Closest Points to Origin
  • Kth Largest Element in an Array
  • Task Scheduler
  • Design Twitter
  • Find Median from Data Stream

10. Backtracking

  • Subsets
  • Combination Sum
  • Permutations
  • Subsets II
  • Combination Sum II
  • Word Search
  • Palindrome Partitioning
  • Letter Combinations of a Phone Number
  • N-Queens

11. Graphs

  • Number of Islands
  • Clone Graph
  • Max Area of Island
  • Pacific Atlantic Waterflow
  • Surrounded Regions
  • Rotting Oranges
  • Walls and Gates
  • Course Schedule
  • Course Schedule II
  • Redundant Connection
  • Number of Connected Components in Graph
  • Graph Valid Tree
  • Word Ladder

12. Advanced Graphs

  • Reconstruct Itinerary
  • Min Cost to Connect all Points
  • Network Delay Time
  • Swim in Rising Water
  • Alien Dictionary
  • Cheapest Flights Within K Stops

13. 1-D Dynamic Programming

  • Climbing Stairs
  • Min Cost Climbing Stairs
  • House Robber
  • House Robber II
  • Longest Palindromic Substring
  • Decode Ways
  • Coin Change
  • Maximum Product Subarray
  • Word Break
  • Longest Increasing Subsequence
  • Partition Equal Subset Sum

14. 2-D Dynamic Programming

  • Unique Paths
  • Longest Common Subsequence
  • Best Time to Buy/Sell Stock With Cooldown
  • Coin Change II
  • Target Sum
  • Interleaving String
  • Longest Increasing Path in a Matrix
  • Distinct Subsequences
  • Edit Distance
  • Burst Balloons
  • Regular Expression Matching

15. Greedy

  • Maximum Subarray
  • Jump Game
  • Jump Game II
  • Gas Station
  • Hand of Straights
  • Merge Triplets to Form Target Triplet
  • Partition Labels
  • Valid Paranthesis String

About

Solutions implemented for data structures and algorithm problems on the internet(especially in LeetCode).


Languages

Language:C++ 96.8%Language:CMake 3.2%