CS 410 Applied Algorithms Applied Algorithms Lecture #5 Sorting.

Slides:



Advertisements
Similar presentations
CS 410 Applied Algorithms Applied Algorithms Lecture #7 Counting.
Advertisements

MRS. MOTT’S ALGEBRA FOUNDATIONS CLASSROOM PROCEDURES.
CSE 332: Lab 6 overview Overview of Lab 6 Your Lab 6 program will –Correct a glitch in the lab 5 specification Use exceptions only for abnormal flow control.
CS102--Object Oriented Programming Discussion 2: (programming strategy in java) – Two types of tasks – The use of arrays Copyright © 2008 Xiaoyan Li.
Hand Crafting your own program By Eric Davis for CS103.
CS150 Introduction to Computer Science 1 Professor: Chadd Williams.
CS 410 Applied Algorithms Applied Algorithms Lecture #3 Data Structures.
CS102--Object Oriented Programming Discussion 1: – Project 4 on Page 328 – The use of arrays Copyright © 2008 Xiaoyan Li.
Lecture 33 CSE 331 Nov 20, Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture.
CS 280 Data Structures Professor John Peterson. Goals Understand “Programming in the small” Java programming Know what’s under the hood in complex libraries.
CS 410 Applied Algorithms Applied Algorithms Lecture #1 Introduction, class information, first problems.
CS 280 Data Structures Professor John Peterson. Goals Understand “Programming in the small” Java programming Know what’s under the hood in complex libraries.
CS 106 Introduction to Computer Science I 03 / 03 / 2008 Instructor: Michael Eckmann.
Administrative Issues ICS 151 Fall 2007 Instructor: Eli Bozorgzadeh.
CS113 Introduction to C Instructor: Ioannis A. Vetsikas Lecture 6 : September 6.
CS 410 Applied Algorithms Applied Algorithms Lecture # Backtracking.
CS 410 Applied Algorithms Applied Algorithms Lecture #6 Arithmetic and Algebra.
Lecture 37 CSE 331 Dec 1, A new grading proposal Towards your final score in the course MAX ( mid-term as 25%+ finals as 40%, finals as 65%) .
Lecture 29 CSE 331 Nov 11, To be strictly enforced For the rest of the semester on Fridays SUBMIT your HOMEWORKS by 1:10 PM.
Ma 109 College Algebra Section 001 Fall 2005 Dr. Carl Eberhart, Professor of Mathematics
If you did the extra credit assignment, please turn in your worksheets now. No late submissions will be accepted. Your score on this worksheet will be.
Please close your laptops and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily 5-minute quiz will be given.
Please close your laptops and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily homework quiz will be given.
1 The game of poker You are given 5 cards (this is 5-card stud poker) The goal is to obtain the best hand you can The possible poker hands are (in increasing.
Please open your laptops, log in to the MyMathLab course web site, and open Quiz 3.6B. IMPORTANT NOTE: If you have time left after you finish the problems.
Computer Science 102 Data Structures and Algorithms V Fall 2009 Lecture 1: administrative details Professor: Evan Korth New York University 1.
CHAPTER 7-1 SOLVING SYSTEM OF EQUATIONS. WARM UP  Graph the following linear functions:  Y = 2x + 2  Y = 1/2x – 3  Y = -x - 1.
MATH 112 (Tuesday) Spring 2015 Instructor:. Syllabus Keep your copy of the syllabus handy  Questions will arise throughout the semester  Answers can.
Welcome to 4 th Grade! Mrs. Owen Mrs. Stephan Ms Santamaria.
CS161 Topic #15 1 Today in CS161 Lecture #15 Practicing! Writing Programs to Practice Write a game program (1 player) of Mad Math Reuse the functions to.
Mrs. Ashford January 9, 2014 U.S. GOVERNMENT CLASS ASSIGNMENTS AND REQUIREMENTS.
Back to School Pre-algebra. What is this class about? Rational and Real Numbers Patterns and Relationships Geometry and Measurement Linear and.
TODAY IN ALGEBRA 1…  Return and review exit slips  Learning Goal: Review Ch.1 for Ch.1 Test.
7 th Grade Math. Course Objectives focuses on four critical areas: focuses on four critical areas: developing an understanding of and applying proportional.
1 My Experiences as Faculty Member and Researcher Dr. Kalim Qureshi.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Gateway Quiz #1 Results: Average class score: x.x% Number of students who passed: x (Passing the Gateway requires a perfect score of 8/8, and very few.
Astronomy 114 Lab Section 211, Professor Weigel. Outline for Today About Goals for this class Attendance Syllabus Safety Star Project Apparent vs. Absolute.
Welcome to Chemistry Teacher’s Name: Dr. Gary Lutz You may call me Dr. Lutz or Mr. Lutz.
Lesson 6-4B Objective: Solve compound inequalities with OR. Two or more combined Union.
With Mrs. Allen.  Grouping is done by ability for math and reading to better meet the needs of each individual student.  Grouping is based on the following.
Derivative – Power Rule, Product Rule, Chain Rule, Quotient Rule Unit 4.
Number Representation, Data Types and Elementary Programming Shirley Moore CS 1401 February 5-7, 2013.
1 Daily Announcements CS 202, Spring 2007 Aaron Bloomfield.
Assignment 1. p2. 1. In a classical card game, we get 5 cards from a deck of 52. Find the probabilities of: (a) 1-pair (b) 2-pair (c) 3-of-a-kind (d)
Getting Started 2.6. Guiding Questions How can solving easier problems help us find the product of a multiplication problem? How can solving easier problems.
Loops.  (No Quiz)  Hand in Assignment #1  Last chance for Q+A on the midterm  Loops 2.
CS 106 Introduction to Computer Science I 03 / 02 / 2007 Instructor: Michael Eckmann.
TODAY IN GEOMETRY…  Review for Ch.3 Quiz  CH.3 QUIZ - TODAY!
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials.
“Epi-” means “upon, to, in addition to / on, over, outside” Take Vocabulary worksheet from my desk and begin working You may move around/work together.
PHY 107 – Programming For Science. Announcements no magic formulas exist  Need to learn concepts: no magic formulas exist  Single solution not useful;
Chemical Hydrogeology GLY What this course is: Diffusion equation Dispersion Convection-Dispersion equation Boundary conditions Sorption Production.
Properties: -The value in each node is greater than all values in the node’s subtrees -Complete tree! (fills up from left to right) Max Heap.
Seventh Grade Mathematics Meghan Cassady St. Mary School
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
CS 360 Lab 1 Professor: Krzysztof Nowak TA: Mark Boady.
Responsibilities CS 4640 Programming Languages for Web Applications
ALGEBRA 1 WELCOME.
Warm-Up #44 1/26/17 Solve each inequality and graph the solutions.
Responsibilities CS 4640 Programming Languages for Web Applications
Administrative Issues
Discussion and Case Rules
Welcome back to Software Development!
CS148 Introduction to Programming II
Administrative Issues
Design and Implementation of Software for the Web
Administrative Issues
Agenda for Unit 8: Defining Arrays in Game Programs
Presentation transcript:

CS 410 Applied Algorithms Applied Algorithms Lecture #5 Sorting

CS 410 Applied Algorithms Homework Grading Notes Again You must turn in your homework in class each Friday. –Give me a paper copy in class. is not convenient for me. You must turn in the report from the judge. –Homework without a Judge report can get a maximum of 85%. –Always turn in a page or two of output. Try and make the input for the output you turn in be non-standard. Test the gotchas! Include some sort of high level description of the strategy your program uses to solve the problem.

CS 410 Applied Algorithms Quiz We have a 10 minute quiz today on the reading – Chapter 4. We will continue to have quizzes until the class gets an average score high enough to convince me that people are doing the reading.

CS 410 Applied Algorithms Paradigms Character Decoding char *rankChoices = " TJQKA"; char *suitChoices = "-CDHS"; void trans(Rank rk[6],Suit st[6], int i, char r, char s) { int j; for (j=2; j<=14; j++) if (rankChoices[j]==r) rk[i] = j; for (j=1; j<=4 ; j++) if (suitChoices[j]==s) st[i] = j; }

CS 410 Applied Algorithms Comparison typedef int Ordering; #define LT 0 #define GT 1 #define EQ 2 Ordering comp(int i, int j) // Compare two ints { if (i==j) return EQ; if (i<j) return LT; if (i>j) return GT; }

CS 410 Applied Algorithms Lexiographic Ordering Ordering lexGraph(int x[], int y[], int low, int high) { int i; // Lexigraphic ordering of x from right- to-left for (i=high; i>=low; i--) { if (x[i] > y[i]) return GT; if (x[i] < y[i]) return LT; } return EQ; }

CS 410 Applied Algorithms Data encodes Control enum handTag {HighCard, Pair, TwoPair, ThreeOfaKind, Straight, Flush, FullHouse, FourOfaKind, StraightFlush}; struct Hand { // The union is the info needed to break ties enum handTag tag; // its either One card or a Set of cards union { Rank highCard[6]; // [lowest.. highest] Rank pair[5]; // [lowest.. highest,Pair] Rank twoPair[4]; // [lone card,lower pair,higher pair] Rank threeOfaKind; // Rank of triple Rank straight; // highest card in straight Rank flush[6]; // [lowest.. highest] Rank fullHouse; // Rank of 3-of-a-kind in full house Rank fourOfaKind; // Rank of quad Rank straightFlush; // highest card in straight } data; } xx; typedef struct Hand HAND;

CS 410 Applied Algorithms

In Class Problems Vito’s Family –Page 88 of the text –We will write this together as a class Bridge –Page 91 of the text –Keeping in mind today’s lecture. –Pairs of two

CS 410 Applied Algorithms Today’s Assignments Read for next time Chapter 5 of the text. pp Be prepared to answer questions in class next Friday from the reading. Programming assignment Shoemaker's Problem - Page 94 Write a solution Submit your solution (until you get it right) Hand in both your program, and the judge output. Those who volunteer to discuss their program get class participation points. me solutions before noon on Friday, May 6.