https://github.com/jeanpaulsio/algorithms-in-ruby
💎
https://github.com/jeanpaulsio/algorithms-in-ruby
algorithms big-o computer-science data-structures
Last synced: 11 days ago
JSON representation
💎
- Host: GitHub
- URL: https://github.com/jeanpaulsio/algorithms-in-ruby
- Owner: jeanpaulsio
- Created: 2019-03-24T21:15:51.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T01:16:38.000Z (9 months ago)
- Last Synced: 2025-04-22T10:38:24.938Z (11 days ago)
- Topics: algorithms, big-o, computer-science, data-structures
- Language: Ruby
- Homepage:
- Size: 121 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Table of Contents
### Arrays and Strings
1. [Clone Even Numbers](./lib/arrays_and_strings/clone_even_numbers.rb)
2. [Reverse String](./lib/arrays_and_strings/reverse_string.rb)
3. [Reverse Array](./lib/arrays_and_strings/reverse_array.rb)
4. [Two Sum](./lib/arrays_and_strings/two_sum.rb)
5. [Shortest Subarray Unsorted](./lib/arrays_and_strings/shortest_subarray_unsorted.rb)
6. [Dutch National Flag](./lib/arrays_and_strings/dutch_national_flag.rb)
7. [Move Zeroes to End](./lib/arrays_and_strings/move_zeroes_to_end.rb)
8. [Kadane's Algorithm](./lib/arrays_and_strings/kadanes_algorithm.rb)
9. [Sliding Window](./lib/arrays_and_strings/sliding_window.rb)
10. [Zero Sum Subarray](./lib/arrays_and_strings/zero_sum_subarray.rb)### Binary Search
1. [Binary Search](./lib/binary_search/binary_search.rb)
2. [First Duplicate](./lib/binary_search/first_duplicate.rb)
3. [Closest Element](./lib/binary_search/closest_element.rb)
4. [Search Insert Position](./lib/binary_search/search_insert_position.rb)
5. [Cyclically Sorted Min](./lib/binary_search/cyclically_sorted_min.rb)
6. [Find With Unknown Length](./lib/binary_search/unknown_length.rb)
7. [Square Root of an Integer](./lib/binary_search/square_root.rb)
8. [Find Array Peak](./lib/binary_search/array_peak.rb)### Recursion and Backtracking
1. [Fibonacci](./lib/recursion_and_backtracking/fibonacci.rb)
2. [Power](./lib/recursion_and_backtracking/power.rb)
3. [Print Combos](./lib/recursion_and_backtracking/print_combos.rb)
4. [Phone Number Mnemonics](./lib/recursion_and_backtracking/phone_number_mnemonics.rb)
5. [Array Subsets](./lib/recursion_and_backtracking/array_subsets.rb)
6. [Array Permutations](./lib/recursion_and_backtracking/array_permutations.rb)
7. [Coin Change](./lib/recursion_and_backtracking/coin_change.rb)
8. [Maze Path Easy](./lib/recursion_and_backtracking/maze_path_easy.rb)
9. [Maze Path Hard](./lib/recursion_and_backtracking/maze_path_hard.rb)
10. [Word Break](./lib/recursion_and_backtracking/word_break.rb)
11. Sudoku Solver
12. N Queens### Linked Lists
1. [Linked List Implementation](./lib/linked_lists/linked_list.rb)
2. [Sort Linked List of 0s, 1s, 2s](./lib/linked_lists/sort_zero_one_two.rb)
3. [Split list's odd and even nodes](./lib/linked_lists/odd_even.rb)
4. [LRU Cache](./lib/linked_lists/lru_cache.rb)
5. Smallest Subarray Covering All Values
6. Reverse a Linked List
7. Check if LL is a palindrome### Stacks
1. [Stack Implementation](./lib/stacks/stack.rb)
2. [Find Number in Stack](./lib/stacks/find_number.rb)
3. [Create Queue with 2 Stacks](./lib/stacks/two_stack_queue.rb)
4. [Create 2 Stacks with Array](./lib/stacks/two_stack_array.rb)
5. [Find Max in Stack](./lib/stacks/stack_with_max.rb)
6. [Evaluate an Infix expression](./lib/stacks/evaluate_infix.rb)## Queues
1. [Queue Implementation](./lib/queues/queue.rb)
2. [Sliding Window Sums](./lib/queues/sliding_window_sums.rb)
3. Stock Prices
4. [Queue With Max](./lib/queues/find_max.rb)
5. Max of Sliding Window---
## Getting Started
```bash
$ git clone https://github.com/jeanpaulsio/algorithms_in_ruby.git
$ bundle install
$ asdf install
```## Running Tests
```bash
$ 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
```