Skip to content

In this project, I implemented various sorting algorithms in Python (bubble, insertion, selection, and merge sort).

Notifications You must be signed in to change notification settings

allienello/SortingMethods-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

In this project, I implemented different sorting methods from the ground up in Python. Utilizing the sorting methods, I addressed an application problem.

This project was for my data structures and algorithms class at university. Areas of the code where it says 'Do not modify' were given by the instructor. Code indicated otherwise by 'Implement below', 'My code below', or 'Modify below' was implemented by me.

Each function I completed had contraints I had to adhere to. This includes runtime and space complexity (as indicate by the docstrings), the skeleton of the function (declaration, parameters, return value), and the overall task or goal.

Using my knowledge on algorithms, I wrote a variety of sorting methods. I also used my course materials (lecture slides and textbooks), as well as LLMs such as chatGPT when I was stuck on certain aspects.

The application problem for this project was written by the instructor. Similar to the rest of the project, I was given the specifications for the function(s) and an explanation of the problem.

//Application Problem Specs//

Imagine spending a night with friends at MSU engaged in extracurricular activities. Hungry and craving a snack, your group opts for Conrad's, renowned for its tantalizing dishes—and infamous night-long queues. In a bid to enhance the customer experience and ensure repeat business, Conrad's introduces an innovative rewards system: For every order containing precisely two food items, customers accrue reward points, calculated by multiplying the two item prices.

Being savvy college students, a scheme is hatched: Why not maximize rewards by manipulating orders and using a single phone number? The challenge? Pairing up orders so that the combined bill of each pair is consistent. And as the designated tech guru enrolled in CSE 331, the task of devising the perfect algorithm falls to you.

Challenge: Your mission, should you choose to accept, is to split the orders into pairs. Each pair's combined item prices should equal a consistent amount. Additionally, compute the collective rewards points for all pairs.

Note: Refrain from using built-in sort functions (although the ones discussed previously are permissible).

About

In this project, I implemented various sorting algorithms in Python (bubble, insertion, selection, and merge sort).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages