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 DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 youre done. Advantages Dont 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 bitsequences 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 bitsequences 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 bitsequences 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 bitsequences 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 bitsequences 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 bitsequences to represent characters....
View
Full
Document
 Summer '08
 Dr.HingFungTing
 Algorithms, C Programming

Click to edit the document details