https://github.com/gregolive/ruby_misc
A collection of methods and projects built to practice Ruby.
https://github.com/gregolive/ruby_misc
Last synced: over 1 year ago
JSON representation
A collection of methods and projects built to practice Ruby.
- Host: GitHub
- URL: https://github.com/gregolive/ruby_misc
- Owner: gregolive
- Created: 2021-09-29T14:12:54.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T12:42:51.000Z (over 4 years ago)
- Last Synced: 2025-02-05T16:40:33.318Z (over 1 year ago)
- Language: Ruby
- Homepage: https://replit.com/@gregolive
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby Misc.
A collection of methods and projects built to practice Ruby.
## 1. Binary Search Trees
A binary search tree (BST) is a type of data structure that stores data in an organized, non-linear way, resulting in faster lookup times compared to linear data structure like arrays and linked lists.
This class is an implementation of a balanced BST, meaning the height of a node children differ by 1 at most. The class contains various methods for adding, removing, balancing and printing the tree.
Live demo on [Replit](https://replit.com/@gregolive/Binary-Search-Trees) ๐
## 2. Bubble Sort
Bubble sort is a simple sorting algorithm that repeatedly steps through a list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
This bubble sort algorithm orders a list of randomized integers from smallest to largest. It is optimized to only check n-1 elements, where n is the number of pass throughs, since the largest unsorted integer always "bubbles" to the top on each pass through. It also also optimized to recognize if the list is sorted before all pass throughs have been completed.
Live demo on [Replit](https://replit.com/@gregolive/Bubble-Sort) ๐
## 2. Caesar Cipher
Creates a Caesar cipher from a string and an integer.
A Caesar cipher is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. It is one of the simplest and most widely known encryption techniques.
Live demo on [Replit](https://replit.com/@gregolive/Caesar-Cipher) ๐
## 3. Custom Enumerables
Recreating some of Ruby's built-in enumerablesโmethods for searching, traversal, and sorting collectionsโto gain a deeper understanding of blocks and procs.
Live demo on [Replit](https://replit.com/@gregolive/Custom-Enumerables) ๐
## 4. Event Manager
A tutorial from the Odin Project to practice Ruby I/O and Google APIs.
The goal is to find the government representatives of each attendee of an upcoming event based on their zip code. The information for the attendees is contained in a CSV and needs to be checked for validity. Using their address and the GoogleCivic API, the government representatives are then appended to an ERB template.
## 5. Linked List
A linked list is a linear collection of data elements whose order is the result of each element points to the next.
In this basic linked list every node contains data and a reference to the next node in the sequence. The LinkedList class contains a variety of methods to add and delete nodes and search for specific indexes and data within the list.
Live demo on [Replit](https://replit.com/@gregolive/Linked-List) ๐
## 6. Merge Sort
Merge sort is a divide and conquer (recursive) sorting algorithm.
First the array is divided into the smallest unit (1 element), then each element is compared with the adjacent list to sort and the two adjacent lists are merged. Finally all the elements are sorted and merged.
Live demo on [Replit](https://replit.com/@gregolive/Merge-Sort) ๐
## 7. Recursion
A collection of recursive Ruby methods made to practice putting recursion into practice.
Live demo on [Replit](https://replit.com/@gregolive/Recursion) ๐
## 8. Stock Picker
Determines the best day to have bought and then sold a stock given an array of it's price history.
Live demo on [Replit](https://replit.com/@gregolive/Stock-Picker) ๐
## 9. Substrings
A method to determine the frequency of substrings contained within a string.
Live demo on [Replit](https://replit.com/@gregolive/Substrings) ๐
## 10. Typing Practice
Typing practice for beginners.
Choose a category (i.e. fruits) and then practice typing words from that category (apple, banana, etc.). When a mistake is made the user is prompted to retry typing the word.
Live demo on [Replit](https://replit.com/@gregolive/Typing-Practice) ๐