Introduction
In the third week of Harvard's CS50x course, I learned about algorithms and how they are used to solve problems in computer science
What are algorithms?
They are a set of instructions for solving a particular problem.
Big O Notation
This was a new concept for me that I found fascinating that refers to a tool used to describe the time complexity of an algorithm. Time complexity is the amount of time it takes an algorithm to run as a function of the input size.
Linear and Binary Search
Linear Search: involves examining each element in a dataset until it finds the desired element. Its time complexity is O(n), where n is the size of the dataset. This means the time it takes to run the algorithm increases linearly with the size of the data set.
Binary Search: This is a more efficient algorithm, its time complexity is O(log n). This search algorithm finds the position of the target value within a sorted array. The time it takes increases logarithmically with the size of the array.
Sorting Algorithms
I also learned about other important algorithms such as bubble sort, selection sort and merge sort.
Conclusion
Overall, I found Week 3 course content to be challenging as well as rewarding. In addition, the labs and the problem sets were very helpful in understanding the concepts.
I am excited to learn more about algorithms and explore more efficient ways to write code.