Computer Science - Lawrence Porquia - Assignment #001: Introduction to sorting algorithms
You are given 3 different programs that each use all three sorting algorithms but you don’t know which algorithm each program uses.
You are also given different text files that contain different-sized lists of sorted, reversed, and random numbers.
Your task is to determine which algorithm each program uses by using the time command in your codespace that tells you exactly how long it took the computer to complete the algorithm and explain why you think so.
You may submit this in a Google document file in the classroom.
Computer Science - Lawrence Porquia - Assignment #002: Implementing sorting algorithms
In today's class we will be doing some hands-on coding in python. we covered the idea of algorithms in that one day i was teaching and now we will implement that knowledge in a program
Your task today is create a python program that utilizes bubble sort and selection sort to sort an random array generated by the random library. this is a bit tricky but don't worry most of the code is already written and all you have to do is figure out a way to implement the sorting algorithms into the program. Pseudocode is provided in the program that tells you what should be inputted in that line, from what I know you should be able to figure out what to do from past assignments in Comp Sci 15/25 but if you have trouble trying to figure it out please don't hesitate to ask me for help.
you will then hand in your assignment using github, i will be teaching you how to create pull requests so i could review it and add it in the repository if it is correct.
Link to slides may be found here
IMPORTANT: In codespaces, you may encounter an error in which when you try to run the programs given or created it will tell you "Permission Denied" and you must run chmod +x "program name" to allow yourself to execute the file as a program. (I.E. "chmod +x sort1")
Some of these assignments was taken from Harvard's online class "CS50" in which the course states
You are free to:
Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material
Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. NonCommercial — You may not use the material for commercial purposes. ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.