# L02 - CS0250 Set 2 1 Greedy heuristics 2 Divide and Conquer...

This preview shows pages 1–9. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS0250, Set 2 1. Greedy heuristics 2. Divide and Conquer 3. Dynamic programming Overview of some basic algorithms design techniques CS0250, Set 2 Greedy heuristics How to be greedy? – At every step, make the best move you can make. – Keep going until you’re done. Advantages – Don’t need to pay much effort at each step. – Usually find a solution very quickly. – The solutions are usually not bad. CS0250, Set 2 An example: Huffman codes (Ch16.3) Some definitions • In computer, we use bit-sequences to represent characters. Example: – Σ = {a,b,c,d}. – a 1, b 01, c 001, d 0001 • Encoding a sequence S of characters by C: – aabaacda 11011100100011 • We call this representation a code for encoding the set of characters {a, b, c, d} CS0250, Set 2 An example: Huffman codes (Ch16.3) Some definitions • In computer, we use bit-sequences to represent characters. Example: – Σ = {a,b,c,d}. – a 1, b 01, c 001, d 0001 • Encoding a sequence S of characters by C: – a abaacda 1 1011100100011 • We call this representation a code for encoding the set of characters {a, b, c, d} CS0250, Set 2 An example: Huffman codes (Ch16.3) Some definitions • In computer, we use bit-sequences to represent characters. Example: – Σ = {a,b,c,d}. – a 1, b 01, c 001, d 0001 • Encoding a sequence S of characters by C: – a a baacda 1 1 011100100011 • We call this representation a code for encoding the set of characters {a, b, c, d} CS0250, Set 2 An example: Huffman codes (Ch16.3) Some definitions • In computer, we use bit-sequences to represent characters. Example: – Σ = {a,b,c,d}. – a 1, b 01, c 001, d 0001 • Encoding a sequence S of characters by C: – aa b aacda 11 01 1100100011 • We call this representation a code for encoding the set of characters {a, b, c, d} CS0250, Set 2 An example: Huffman codes (Ch16.3) Some definitions • In computer, we use bit-sequences to represent characters. Example: – Σ = {a,b,c,d}. – a 1, b 01, c 001, d 0001 • Encoding a sequence S of characters by C: – aab a acda 1101 1 100100011 • We call this representation a code for encoding the set of characters {a, b, c, d} CS0250, Set 2 An example: Huffman codes (Ch16.3) Some definitions • In computer, we use bit-sequences to represent characters....
View Full Document

{[ snackBarMessage ]}

### Page1 / 44

L02 - CS0250 Set 2 1 Greedy heuristics 2 Divide and Conquer...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online