5626463547 | San Jose, CA 95126

Bubble Sort

Bubble sort, also sometimes called sinking sort, is a sorting algorithm that is sometimes used to introduce algorithms. It turns out that it is a pretty inefficient means of sorting, especially if the list is very much unsorted and contains many elements. For that reason, some textbooks now avoid teaching Bubble sort; the idea is that its impracticality undermines its pedagogical use. But I disagree. When learning other concepts, such as the meaning of "valid" in a critical reasoning or first-order propositional logic course, it is common to present valid arguments that no one would ever use for the purpose of arriving at true beliefs.  Those arguments can nevertheless be a good heuristic for grasping what validity is. It is sometimes the case that thought experiments or ideas [...]

2018-06-07T21:33:50+00:00 January 23rd, 2016|Comments Off on Bubble Sort

Binary Search

The value of binary search is that you can search for whether an item exists in a sorted list, array, etc. without having to look at possibly every single item. Suppose you have a sorted array of integers but you do not know what numbers exist in the array. What you do know is that the array is sorted from lowest to highest, there are 1000 elements in the array, and the number you are looking for is 256. A simplistic approach is to start at index 0, check if it is equivalent to 256, if not, then check the next item, and the next item, until you've checked all the items and either found or not found the item.  If 256 was the first item, you would be done on the first comparison. [...]

2018-06-07T21:33:36+00:00 January 22nd, 2016|Comments Off on Binary Search