In high school you may have seen a definition of logarithm that included multiplication. We get by computing the product of three tens. We get by computing the product of ten twos. When we ask for the logarithm base ten of a number we are asking: “To what power must I raise to get ?”…
Month: November 2026
Selection sort vs. insertion sort
Let’s suppose that we are sorting a list of N elements. We have placed these numbers on a horizontal line. When we are done, each number will be greater than or equal to its neighbor on the left. The left-most number will be the smallest number and the right-most number will be the largest. Both…
Why study searching and sorting algorithms?
We study searching and sorting algorithms because they appear in the solutions of many problems. We study searching and sorting algorithms because they are simple. We can produce a program that searches or sorts data by writing just a few lines of code. We can see the whole program at once. We do not have…