/Algorithms

All algorithms and data structures

Primary LanguageJava

Algorithm

All algorithms and data structures by Java, JavaScript, Python.

Java

Data structure

Arrays and Strings

  • Caesar cipher
  • Check permutation
  • Check unique char
  • Compress string
  • Cyclic rotation
  • Equilibrium index
  • Find missing element
  • Odd occurence in array
  • Reverse string
  • Rotate matrix
  • Rotate string
  • Second max
  • Tape equilibrium
  • URLify
  • Zero matrix

HashTables

  • Camouflage
  • Distinct
  • Missing integer

LinkedLists

  • Basic linked list
  • Delete duplications
  • Linked list by recursive

Stacks and Queues

  • Brackets
  • Fish the eat
  • Nest
  • Queue
  • Queue test
  • Stack
  • Stack test

Math

  • Binary gap
  • Chocolates by numbers
  • Count cars
  • Count div
  • Count factors
  • Equi leader
  • Find min prime factor
  • Frog jump
  • Is prime number
  • Min max holiday
  • Min perimeter rectangle
  • Multiples of 3 and 5
  • Perm check
  • Sieve of eratosthenes

Recursive

  • Combination
  • Combination test
  • Dice game
  • Factorial
  • Fibonacci
  • Fibonacci using memo
  • Permutation
  • Permutation test

Sorting and Searching

  • Binary search
  • Bubble sort
  • Find maximum repeating num
  • Insertion sort
  • Is duplicate
  • Max product of three
  • Mock test
  • Quick sort
  • Selection sort
  • Shell sort
  • Triangle
  • Unique integer

JavaScript

Data structure

Arrays and Strings

  • 2D Array
  • Anagrams
  • Array manipulation
  • Atoi
  • Atoi with regex
  • Binary strings without consecutive
  • Caesar cipher
  • Compare the triplets
  • Contains duplicates
  • Convert upper to space
  • Convert 0 to many
  • Count and say sequence
  • Count and say sequence(Recursive version)
  • Counting valleys
  • Diagonal difference
  • Electronics shop
  • Element Equal To Index
  • Equalize array
  • Find a position where the sum of the left and right is equal
  • Find duplicate element
  • Find main element
  • Find missing element
  • Find two indexes
  • First Unique Character in a String
  • Intersection of Two Arrays
  • Is cipherable
  • Largest sum
  • Left rotation
  • Longest bitonic subsequence
  • Longest common prefix
  • Longest substring length
  • Max gap
  • Maximum subarray
  • Maximum subarray in circular array
  • Max profit
  • Max multiplier
  • Merge interval
  • Merge sorted arrays
  • Merge sorted arrays(no-tricky)
  • Mini max sum
  • Move zeroes
  • Multiply others
  • Num of ids
  • Plus one
  • Racer
  • Ransom note
  • Remove Duplicates
  • Reverse Integer
  • Reverse string
  • Reverse string in each word
  • Right rotation
  • Rotate image
  • Simple array sum
  • Singe number
  • Sock merchant
  • Sort 0 1 2
  • Sort two arrays
  • Sparse array
  • strStr
  • Sudoku
  • Two sum
  • Valid Anagram
  • Valid Palindrome

HashTable

  • Distinct

LinkedList

  • Add two numbers
  • Delete node
  • Delete node in a linked list
  • Insert node at head
  • Insert node at position
  • Remove Nth from end
  • Reverse linked list
  • Singly linked list

Tree

  • Maximum Depth Of Binary Tree
  • Validate binary search tree

Implementation

  • Apple and orange
  • Between two sets
  • Dynamic array
  • Find length of common prefix
  • Kangaroo
  • Lost clothes
  • Min stack
  • Plus minus
  • Shuffle an array
  • Staircase

Math

  • A very big sum
  • Cat and mouse
  • Find hidden numbe
  • Find the point
  • Fizz Buzz
  • Hurdle race
  • Jumping on clouds
  • Power of three
  • Repeated string
  • Strange grid again

Recursive

  • Brackets
  • Climbing Stairs
  • Combination
  • Factorial
  • Fibonacci
  • Palindrome
  • Permutation
  • Subset sum

Sorting and Searching

  • Binary search
  • Binary search recursive
  • Binary sort
  • Bubble sort
  • Bubble sort with swap count
  • Find Nth largest element in an array
  • First bad version
  • First last position
  • Mark and toys
  • Merge sorted array
  • Move zeros
  • Position Larger than next each other
  • Radix sort
  • Shuffle array

Python

Data Structure

Linked List

  • Merge two sorted linked list

Math

  • Count char

Recursive

  • Count
  • Euclidean
  • Factorial
  • Max
  • Recursive Sum

Sort and Search

  • Breadth-First Search
  • Binary search
  • Selection sort
  • Quick sort