Mod 3 Lesson 2 Me First! Sorting

Slides:



Advertisements
Similar presentations
Visual C++ Programming: Concepts and Projects
Advertisements

Search and Sort.
Searching and Sorting Topics  Sequential Search on an Unordered File  Sequential Search on an Ordered File  Binary Search  Bubble Sort  Insertion.
Algorithms for Sorting Things. Why do we need to sort things? Internal Telephone Directory –sorted by department then by name My local video store holds.
Computer Science 101 Fast Searching and Sorting. Improving Efficiency We got a better best case by tweaking the selection sort and the bubble sort We.
Searching and Sorting Topics Linear and Binary Searches Selection Sort Bubble Sort.
Sorts Tonga Institute of Higher Education. Introduction - 1 Sorting – The act of ordering data Often, we need to order data.  Example: Order a list of.
Sorting List is rearranged into sorted order How is the sorted order determined? – The ItemType is responsible for determining the key to be used in comparison.
New Mexico Computer Science For All Sorting Algorithms Maureen Psaila-Dombrowski.
Searching & Sorting Programming 2. Searching Searching is the process of determining if a target item is present in a list of items, and locating it A.
1 Searching and Sorting Searching algorithms with simple arrays Sorting algorithms with simple arrays –Selection Sort –Insertion Sort –Bubble Sort –Quick.
Reading a Ruler.
Using Cornell Notes To learn the art of taking notes using the Cornell Format of note-taking. In this class, information will come from a variety of sources.
Oral English Listening Quiz! November 2011 “Quiz” means “small examination” 小测验.
Can you put these children’s TV shows in date order - earliest to latest?
Lists and Sorting Algorithms
CPS120: Introduction to Computer Science Sorting.
CMSC 104, Version 8/061L24Searching&Sorting.ppt Searching and Sorting Topics Sequential Search on an Unordered File Sequential Search on an Ordered File.
Within 5 minutes of the bell ringing:
3.3 Fundamentals of data representation
Searching and Sorting Algorithms
Lesson Objectives To be able to identify the key features of Public Health and explain what it is To be able to give examples of how Public Health developed.
Integer Operations X and ÷
Types of Sentences Review
Sorting Algorithms.
UNIT 3 – LESSON 5 Creating Functions.
FRACTIONS DECIMALS & PERCENTS
Go Math! Chapter 1 Lesson 1.3, day 1 Comparing Numbers
Science Starter What happens when you “push” or “pull” something?
Remember how we can use partitioning to help us to subtract?
Warm Up Alex is trying to win a jumping jack competition. He does
Building Skills for High School & College Success
Mergesort: The power of divide and conquer
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Sorting Algorithms Written by J.J. Shepherd.
Binary Search Back in the days when phone numbers weren’t stored in cell phones, you might have actually had to look them up in a phonebook. How did you.
Last Class We Covered Data representation Binary numbers ASCII values
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Selection Sort Sorted Unsorted Swap
Searching and Sorting Topics Sequential Search on an Unordered File
Taking A Different Approach
“Human Sorting” It’s a “Problem Solving” game:
Searching and Sorting Topics Sequential Search on an Unordered File
Last Class We Covered Dictionaries Hashing Dictionaries vs Lists
Strategies and Diagnostic Exam
Plenary
Year 4 (National Numeracy Strategy) (Based on DFEE Sample Lessons)
UMBC CMSC 104 – Section 01, Fall 2016
Within 5 minutes of the bell ringing:
Searching and Sorting Topics Sequential Search on an Unordered File
Principles of Computing – UFCFA3-30-1
Searching and Sorting Arrays
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Intro to Cornell Notes
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Year 2 Spring Term Week 2 Lesson 4
Welcome to Active Learning Activities for Stats
Scratch –Think Like a Computer
Year 2 Spring Term Week 2 Lesson 4
Combining Like Terms.
CSCE 3110 Data Structures & Algorithm Analysis
CSCE 3110 Data Structures & Algorithm Analysis
Principles of Computing – UFCFA3-30-1
Welcome!.
CSCE 3110 Data Structures & Algorithm Analysis
“Human Sorting” It’s a “Problem Solving” game:
Kindness Letter You will write a letter to a stranger that will be filled with and based on kindness. The letter must be a page long, but can be longer.
Presentation transcript:

Mod 3 Lesson 2 Me First! Sorting Please get out a piece of paper for notes. Include your name, Date Sorting Algorithms You will turn these in later. Intro to Programming Mod 3 Lesson 2 Me First! Sorting

Learning Objectives Students will be introduced to the idea of sorting data in order. Students will be able to sort information using several algorithms.

Getting Started Activity There is no talking in this activity!!!! I will break you into groups and you will need to put yourselves in order, based on the month in which you were born. Remember, no talking!!

After the Activity Check the groups How many comparisons did you make Now, again without talking, organize the entire class by day of the month in which you were born. What was the effect of trying to organize the entire group? Can you suggest a more efficient method?

How do you put things in order? Watch the first Sorting Video Two items Three items Four Ten 52 100 10000000000000000000000000000000

How did the first video sort the items? On your notes, give a summary of the Bubble sort as well as the sample below. Bubble Sort Slow Works by checking two values, if they are out of order, switch them (Check-Switch) Your turn: Sort the following from low to high showing each pass. Low High 30 15 8 12 20 9 1

Are there any other ways to sort? Let’s look at another method of sorting The selection sort. Watch the video How does it work?

Selection Sort How fast is it? How it works Check for the smallest On your notes, give a summary of the Selection sort as well as the sample below. How fast is it? How it works Check for the smallest Switch. It is counted as a pass every time there is a switch. (Check, Mark, Switch) More efficient than the Bubble Sort. Your turn Sort the following, showing each pass. Low High 30 15 8 12 20 9 1

Quick Sort Watch the video Can you describe how this sort works? On your notes, give a summary of the Quick sort as well as the sample below. Watch the video Can you describe how this sort works? Pick a card Put the cards smaller to the left, the cards larger to the right Pick up the pile to the left and repeat Pick up the pile to the right and repeat The most efficient of the three A ‘Divide and Conquer’ sort

Summary Mark a section on the bottom of your paper “Summary:” Summarize today’s ideas Bubble, Selection and Insertion Sorts How to they work? Which do you like best and why? When finished turn it into the Macintosh