Skip to content

jeanpaulsio/algorithms-in-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

Arrays and Strings

  1. Clone Even Numbers
  2. Reverse String
  3. Reverse Array
  4. Two Sum
  5. Shortest Subarray Unsorted
  6. Dutch National Flag
  7. Move Zeroes to End
  8. Kadane's Algorithm
  9. Sliding Window
  10. Zero Sum Subarray

Binary Search

  1. Binary Search
  2. First Duplicate
  3. Closest Element
  4. Search Insert Position
  5. Cyclically Sorted Min
  6. Find With Unknown Length
  7. Square Root of an Integer
  8. Find Array Peak

Recursion and Backtracking

  1. Fibonacci
  2. Power
  3. Print Combos
  4. Phone Number Mnemonics
  5. Array Subsets
  6. Array Permutations
  7. Coin Change
  8. Maze Path Easy
  9. Maze Path Hard
  10. Word Break
  11. Sudoku Solver
  12. N Queens

Linked Lists

  1. Linked List Implementation
  2. Sort Linked List of 0s, 1s, 2s
  3. Split list's odd and even nodes
  4. LRU Cache
  5. Smallest Subarray Covering All Values
  6. Reverse a Linked List
  7. Check if LL is a palindrome

Stacks

  1. Stack Implementation
  2. Find Number in Stack
  3. Create Queue with 2 Stacks
  4. Create 2 Stacks with Array
  5. Find Max in Stack
  6. Evaluate an Infix expression

Queues

  1. Queue Implementation
  2. Sliding Window Sums
  3. Stock Prices
  4. Queue With Max
  5. Max of Sliding Window

Getting Started

$ git clone https://github.com/jeanpaulsio/algorithms_in_ruby.git
$ bundle install
$ asdf install

Running Tests

$ ruby lib/arrays_and_strings/reverse_string_test.rb

Watching Tests

If you prefer not to run tests manually, you can run:

$ bundle exec guard