Ivan Li.  #Max = 9  Mean (attempted) = 39.4 42.

Slides:



Advertisements
Similar presentations
Flow, Inventory, Throughput, and Little’s Law
Advertisements

QuickSort Example 13, 21, 15, 3, 12, 9, 14, 7, 6 3, 3, 9, 3, 9, 7, 3, 9, 7, 6, First we use the number in the centre of the list as a ‘pivot’. We then.
An intro to programming concepts with Scratch Session 8 of 10 sessions Working with lists; sorting a list.
Acceleration Problems
1D Kinematics.
Index Values NATIONAL STATISTICAL COORDINATION BOARD.
Normal-Tangential coordinates
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (3) Recurrence Relation 11/11 ~ 11/14/2008 Yang Song.
 2003 Prentice Hall, Inc. All rights reserved Sorting Arrays Sorting data –Important computing application –Virtually every organization must sort.
Searching Arrays Linear search Binary search small arrays
Advance Data Structure 1 College Of Mathematic & Computer Sciences 1 Computer Sciences Department م. م علي عبد الكريم حبيب.
8-1 Relations and Functions. RELATIONS Relation: A set of ordered pairs. Domain: The x values of the ordered pairs. Also known as the input value. Range:
Problem Solving and Mazes
Momentum. Explain what is happening in the picture… Why did the blond-haired kid miss getting the chips? What does the kid need to do in order to get.
SEARCHING. Vocabulary List A collection of heterogeneous data (values can be different types) Dynamic in size Array A collection of homogenous data (values.
The CK Metrics Suite. Weighted Methods Per Class b To use this metric, the software engineer must repeat this process n times, where n is the number of.
CSC 211 Data Structures Lecture 13
Travel graphs Friday, 06 November 2015 Starter: June 05 Q1.
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.
Momentum. What is Momentum? Momentum – tendency of objects to keep going in the same direction with the same speed –Depends on mass and velocity –Has.
Sorting & Searching Review. Selection Sort 1. Find the smallest element 2. Move to the front of the array (swap with front) 3. Repeat Steps 1&2, but ignoring.
VCE IT Theory Slideshows By Mark Kelly Vceit.com Arrays.
Calculating Acceleration
Lecture 7 Derivatives as Rates. Average Rate of Change If f is a function of t on the interval [a,b] then the average rate of change of f on the interval.
Momentum. What is Momentum? Momentum – tendency of objects to keep going in the same direction with the same speed –Depends on mass and velocity –Has.
Graphing Cosine and Sine Functions Obj: graph sine and cosine on graph paper and notebook paper.
Lecture 15 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Data Structures and Algorithms Searching Algorithms M. B. Fayek CUFE 2006.
Course Code #IDCGRF001-A 5.1: Searching and sorting concepts Programming Techniques.
Kinematics Problems. A runner accelerates from 0 to 6.00 m/s in 3.00 s. What is the runner’s acceleration?
Momentum  Momentum is a property of moving matter.  Momentum describes the tendency of objects to keep going in the same direction with the same speed.
Site Selection The following are photographs of the sites from which you may choose your water samples. After reviewing the photos, you will use the map.
Section 2.2 Quadratic Functions. Thursday Bellwork 4 What does a quadratic function look like? 4 Do you remember the standard form? 4 How could we use.
A car travels north at 21 m/s for one half hour. It then travels south at 35 m/s for 10 minutes. The total distance the car has traveled and its displacement.
CALCULATING SPECIFIC HEAT CAPACITY Using lab data and your understanding of thermal energy!
Two marbles roll for eight seconds. We observe them from above. Each ball started from rest at the same time. The numbers on the marbles represent the.
Objective: SWBAT find missing angles that are supplementary or around a point.
DEVRY FIN 515 Week 2 Quiz Check this A+ tutorial guideline at For more classes visit
Searching Arrays Linear search Binary search small arrays
Haugdagain Roundabout
Sort Algorithm.
A spherical balloon is being inflated such that its volume increases at a constant rate of 10 cm3 per second. When the radius of the balloon is 5 cm, what.
Midpoint and Distance Formulas
Momentum.
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
12.1 Momentum Momentum is a property of moving matter.
Priority Queues Linked-list Insert Æ Æ head head
Complete the missing numbers using the inverse.
Building Java Programs
Lecture 14: binary search and complexity reading:
CSc 110, Spring 2017 Lecture 39: searching.
POLAR COORDINATES Point P is defined by : P    .
Momentum.
Sorting Algorithms Ellysa N. Kosinaya.
Momentum.
Lecture 15: binary search reading:
Traffic Safety.
Building Java Programs
How many natural numbers less than 1000 are there, so that the sum of its first digit and last digit is 13? Solution: Since it’s less than 1000, our number.
Proportion.
Calculating Acceleration
Sum this up for me Let’s write a method to calculate the sum from 1 to some n public static int sum1(int n) { int sum = 0; for (int i = 1; i
Russian multiplication
BEARINGS.
stays there for a second, and then runs back to P
Maximum and Minimum Points
Airlines Help desk Customer Service TRAVEL AROUND THE WORLD.
Warmup Which of the 4 sorting algorithms uses recursion?
3.4 The linear function y = mx + b
Calculating Acceleration
Presentation transcript:

Ivan Li

 #Max = 9  Mean (attempted) =

 A car travels to the South  If it reaches a road, follow its direction  Find the number of roads visited

 The travel direction is S, E or W ◦ Cannot go North!  There are polar bears in the South ◦ In zoos =]

 Whether a car will reach a road on the south depends on the x coordinates of the car and the start and end points of the road ◦ (x1 ≤ x and x ≤ x2) or (x2 ≤ x and x ≤ x1) ◦ (x1-x)*(x2-x) ≤ 0  Cool but risky =]  After the car finishes travelling on a road, its position is in the end point

 For each road, check if the car will hit it if the car go straight ◦ Road on the south of the car? ◦ Check x coordinates?  If it will, calculate the time (difference in y coordinates) the car will hit the road  Then go hit the road with min time!  Repeat the process until the car hit no roads  O(n 2 )

 After the car has passed a road ◦ i.e. y coordinates of car smaller than road ◦ Then we can ignore the road sayonara!!!  When the car has y coordinate equals that of a road ◦ Hit or miss ◦ Hit: change the position of the car, bye to the road ◦ Miss: Just bye to the road  The y coordinates of the car won’t increase ◦ The car must visit the roads in y order ◦ The input is sorted!

 Keep the index of the last road not passed  Hit or Miss?  Increment the index  Complexity O(n)