Download presentation

Presentation is loading. Please wait.

Published byBobby Fletcher Modified over 2 years ago

1
D1 Algorithms Sorting algorithms

2
Bubble sort- repeated passes through a list of numbers by comparing and switching adjacent numbers Try for 16, 9, 4, 6,

3
Quick sort Try with 19, 9, 4, 6,

4
Exercise 1B

5
Exam questions

9
Bin packing algorithms packing with as few bins/boxes as possible BoxABCDEFGHIJ HEIGHT (M) 0.80.60.70.50.90.40.30.60.50.6

10
Full bin combinations only suitable for small problems BoxABCDEFGHIJ HEIGHT (M) 0.80.60.70.50.90.40.30.60.50.6 Example A + C 8+7=15 FULL BIN B + E6+9=15 FULL BIN H + J + G6+6+3=15 FULL BIN D + I + F 5+5+ 4=14REMAINING BIN

11
First fit algorithm taking the boxes in the order listed and place in the next box available A (8) BIN 1LEAVING 7 B(6) BIN 1LEAVING 1 C(7)BIN 2LEAVING 8 D(5)BIN 2LEAVING 3 E(9)BIN 3LEAVING 6 F(4)BIN 3 LEAVING 2 G(3)BIN 2LEAVING 0 H(6)BIN 4LEAVING 9 I (5) BIN 4LEAVING 4 J(6) BIN 5 LEAVING 9 Although this has led to a further bin being used it is an attempt for a good solution known as a HEURISTIC ALGORITHM FIRST FIT DECREASING ALGORITHM- REORDER BOXES USING A SORTING ALGORITHM FIRST THEN FOLLOW THE FIRST FIT ALGORITHM

12
EXERCISE 1C

13
Exam questions June 08 q1 June 10 q 3 Jan 11 q 2 Jan 12 q 5

Similar presentations

OK

Bubble Sort Algorithm It is so named because numbers (or letters) which are in the wrong place “bubble-up” to their correct positions (like fizzy lemonade)

Bubble Sort Algorithm It is so named because numbers (or letters) which are in the wrong place “bubble-up” to their correct positions (like fizzy lemonade)

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on indian air force free download Ppt on agriculture free download Ppt on equality in indian democracy Ppt on breast cancer screening Ppt on ancient indian mathematicians and their contributions Ppt on tsunami in india Ppt on road traffic in india Ppt on new technology in electronics Ppt on articles of association pdf Ppt on artificial intelligence for speech recognition