Iterative Algorithms Summary
Computer Science 30
Start here: http://www.csfieldguide.org.nz/en/chapters/algorithms.html
Alberta Education Credit Title: CSE3110 Iterative Algorithms 1
Evaluation Guide: For this credit the following will serve as the skills breakdown:
Background
This credit will therefore cover 6 broad concepts
Before you begin, create a new Netbeans Project called Iterative Algorithms.
Concept 0: Review
Marked Assignment: Bike-A-Thon Fundraising
Concept 1: The Binary Search Algorithm
3-4 classes.
All assignments in this concept are due before class on: tba
Learning about Binary Search:
Begin by reading the main story on the following link. Hunting Dragons with Binary Search
Here are the basics:
A Sequential search is a search that consists of taking a list of elements and going through the list one element at a time until the desired element is found. This is the simplest search algorithm and also the least cost effective. It is essentially a brute-force search method. This is only good for lists that have only a few elements in them.
A Binary search is a search that takes a given SORTED list (an array) and goes directly to the middle element. It then checks that element and see's if it match's what it is searching for if not then it will check to see if the element is greater or less than the element it is searching for. If the middle element is greater it will take the lower half and do the same thing all over again until the desired element is found. If the middle element is lesser it will then take the greater half and do the same thing all over again until the desired element is found. This search algorithm is much faster and more cost effective then a Sequential search and will take less time in larger lists.
You have more than one option for learning about it. The key is that you have a thorough grasp of how to do it for both numbers and strings.
Option 1: Watch the following two YouTube videos on Binary Searching. They are each about 12 minutes long and do a very good job at fully explaining the algorithm. You do NOT need to type out the java code just watch THOUGHTFULLY.
Option 2: Search the internet and other explanations or videos that explain the binary search algorithm to you.
Very Important Setup Step:
Create a file in your Iterative Algorithms project called SearchAndSort.java. This file will be used throughout the rest of the credit. You will be asked to copy and paste methods into this file. You can then access these methods from any other .java file you create within this or other credits.
Marked Assignment: Binary Search Assignment 1: Blue Pelican (less than one class)
Marked Assignment: Binary Search Assignment A (less than one class)
Marked Assignment: Binary Search Assignment B - Using Strings (less than one class)
>80% Assignment: Binary Search C: Using Files to Create big data sets
>80% Assignment: Searching Objects
Concept 2: Sorting Algorithms
Approximately 3 classes.
All assignments in this concept are due before class on: TBA
Marked Assignment: Sort 1: BubbleSort (1ish class)
Marked Assignment: Sort 2: Selection and Insertion Sort (30 minutes)
Marked Assignment: Sort 3: Sorting Strings (1ish classes)
>80% Assignment: Comparing Algorithms Assignment - see separate document (1ish class)
>80% Test your knowledge: Explain how the algorithms work using a deck of cards. You will be asked to demonstrate the sort algorithms without help. For this year, you only need to explain one sort algorithm plus the binary search. (Next year I am going to make my students demo one for 90% and all three for 100%). You will have only 2 chances to get it right so be ready! Let me know when you are ready for this oral exam.
Concept 3: Merge Algorithms
Approximately 1 class.
Marked Assignment: Merge Algorithm Assignment - see separate document
Concept 4: Major Project (Putting it all together)
Approximately 4 classes.
Marked Assignment: see separate document