Friday, December 16, 2022

CPT 307: Newbie to Newbie Part 2 - Data Structures and Algorithms

Throughout this course, we learned about data structures and algorithms when writing computer programs. We learned about the importance of writing more efficient programs. This course also gave us some experience with writing code in Java.

In week 2 we learned different methods for writing programs to search for information in a list and different ways to sort data. Of the different search and sort methods, some methods are much more efficient than others. With computer programming there are many ways to get a final desired result. The most efficient way is usually the most desired.


Insertion sorting (left) and merge sorting (right) (Seif, 2022)

In week 4 we were worked on recursion problems. Recursive programs are defined in terms of themselves. I provided an example below of a factorial program that I did for this week’s interactive assignment. We were given the choice of two recursion problems from this website https://codingbat.com/java/Recursion-1 and encouraged to look at our classmates’ solutions to their problems.

In the different algorithms discussed throughout this course, we learned that efficiency of a program has always been important since computers were much larger and slower than they are today. This is still very important for programmers to consider today. Our textbook discussed the O notation, which is a way to evaluate the efficiency of an algorithm. Algorithms can be shortened down and compared to the functions in the left-hand columns of the tables below. N is the number of iterations that the program is run through and the time of running the program that many times is estimated below.

In addition to these lessons of algorithmic design and data structures, we learned some Java programming. I wish I had more time to learn more Java in the past 5 weeks, but I am sure that will be another learning adventure for me in the future. It may be a while, but I intend to post on my further learnings of Java.

References

Data Structures: Lecture 2. (n.d.). https://www.cs.utexas.edu/users/djimenez/utsa/cs1723/lecture2.html

Java Program to Find Factorial of a Number Recursively - GeeksforGeeks. GeeksforGeeks | A computer science portal for geeks. (n.d.). Retrieved December 6, 2022 from https://www.geeksforgeeks.org/java-program-to-find-factorial-of-a-number-recursively/.

Lysecky, R., Vahid, F., Lysecky, S., & Givargis, T. (2015). Data structures essentials. zyBooks.

Seif, G. (2022, February 11). A tour of the top 5 sorting algorithms with Python code. Medium. https://medium.com/@george.seif94/a-tour-of-the-top-5-sorting-algorithms-with-python-code-43ea9aa02889

No comments:

Post a Comment

I Have Completed My Degree in Computer Software Technology

Today is the day that I have been looking forward to for the last couple of years. I have put a lot of hard work and dedication into my stud...