View On GitHub
Tri 3 CSA Kyle M
Website for Kyle Myint's Tri 3 CSA Work
Project maintained by
kylem314
Hosted on GitHub Pages — Theme by
mattgraham
Kyle Myint
Member of m22p2-BTBW
Home
Tech Talks
Java Work
Test Prep
Review
Repl Link
Week 3 Assignment (Sorts)
Link to code
Same as last week, isolated repl
here
Bubble Sort
This sorting method will go through the data, comparing 2 adjacent entries and rearranging them if necessary
It will repeat this process until the full dataset is sorted
Insertion Sort
This method iterates through the dataset, and for each iteration, finds one entry
It will then insert that entry into an output list where it belongs in the sorted order
Merge Sort
This method splits up the data into multiple subsets
It will then sort each subset, which would be faster since fewer elements are being checked
It then puts together the sorted subsets to create the final sorted dataset
Big O Complexity
Bubble sort: O(n^2)
Insertion sort: O(n^2)
Merge Sort: O(n log(n))
Merge sort is the most efficient sorting method of these for large datasets
Data
Bubble sort
Insertion sort
Merge sort
Week 2 Assignment (Calculator)
Link to code
(Worked with Kevin Do)
Note: Code isn’t working on main repo, running
here
though
Preliminary definitions
Operations created using a hashmap, associated with their precedence (lower precedence is executed first)
Square root function added
Output
Original, RPN, and calculator
Parsing through RPN
Create stack to store data, and add to it if number
If it’s an operator, calculate and then put it back on stack
Final number left will be solution
Test cases and user input
Week 0 Assignment
Link to code
Menu created, using a hashmap
Works like a dictionary, and allows for different classes to be run from menu
Number swapper
Compares numbers to find which is greater
Returns printed statements for before and after running swap method