220 likes | 348 Views
CT 100 Weeks 14 and 15. Quiz 14 Vocabulary. All vocabulary from week 13 and the following terms Polynomial time algorithm Exponential time algorithm Undecidable (or non-computable) problem. Quiz 14 Vocabulary. Polynomial time algorithm
E N D
Quiz 14 Vocabulary • All vocabulary from week 13 and the following terms • Polynomial time algorithm • Exponential time algorithm • Undecidable (or non-computable) problem
Quiz 14 Vocabulary • Polynomial time algorithm • An algorithm with an execution time that is a polynomial function of the input size • Exponential time algorithm • An algorithm with an execution time that is an exponential function of the input size • Undecidable (or non-computable) problem • A problem for which no algorithm can exist
Quiz 14 Problems • Evaluate Excel Formulas • Evaluate String Operations • Evaluate Regular Expressions • Write Regular Expressions
Final Exam • The final exam has 2 parts • The final exam is cumulative • Studying for the final exam • Study final exam vocabulary • Study all old quizzes • Study lecture notes • Study assignments
Final Exam Part 1 • Wednesday December 11 in Class • 20 points • Vocabulary • A few short answer and multiple choice questions • No Notes
Final Exam Part 1 Vocabulary • Bit • Byte • Algorithm • Syllogism • Data Compression • Premise • Law of non-contradiction • Law of the excluded Middle • Character code • Logic gate • Primary key • Foreign key • Cartesian product of tables • Referential integrity • Event • Loop • Selection (if statement) • Query
Final Exam Part 1 Vocabulary • Operating System • Processor • Stored program architecture • Arity of an operator • Operand • Operator • Precedence of an operator • Associativity of an operator • Indexing of strings • Concatenation of strings • Regular expression • Polynomial algorithm • Exponential algorithm • Undecidable • Tautology • Premise • SQL • Join of tables
Final Exam Part 2 • 2:30-4:30 Friday December 13 • 80 points • In Room 2314 Centennial • You can bring 1 8.5X11 inch piece of paper with notes. The notes must be hand written and you can use both sides. You do not have to write the ASCII table. I will give you that.
Assignment 3 • Due 11:00 AM Wednesday December 4 • See handout
Which strings on the right match the regular expressions on the left • . • .* • \d • \d* • \D* • \w* • [0-9][0-9](\D)* • .*(abc).* • “x” • “%23a” • “9” • “” • “4192” • “abc” • “84#abcdef” • “46” • “81xyz”
Which strings on the right match the regular expressions on the left • (\D)*\d\d\d • [A-Za-z]*(\s)+[0-9][0-9] • …[0-9]{3}.? • “ 32” • “Abz817” • “&1A569” • “a 02” • “776” • “1234567” • “abc1234”
Write Regular Expressions to match the patterns described below • 1 or more digits • 1 or more digits followed by a colon followed 0 or more digits • 1 to 8 upper or lower case letters • 2 characters followed by 2 digits followed by 0 or more upper case letters • An optional character followed by 3 upper or lower case letters followed by 1 or more whitespace characters followed by 0 or more digits
Which strings on the right match the regular expressions on the left • ..[0-9]?.. • (0|1)+ • [A-Za-z]([0-9]|[A-Za-z])* • [0-9]{5}(-[0-9]{4})? • “ABCD” • “001101” • ##7$% • 54601-1234 • 54603 • wa32c1
Write a phrase that describes the regular expressions shown below • ..[0-9]?.. • Two characters followed by an optional digit followed by 2 characters • (0|1)+ • A string of one or more 0s and 1s • [A-Za-z]([0-9]|[A-Za-z])* • A letter followed by 0 or more letters and digits • [0-9]{5}(-[0-9]{4})? • 5 digits followed by an optional dash and 4 digits
Write a phrase that describes the regular expressions shown below • (\D)*\d\d\d • [A-Za-z]*(\s)+[0-9][0-9] • …[0-9]{3}.?
Write Regular Expressions to match the patterns described below • Three digits followed by a comma followed by three digits • An optional 3 digits and a comma followed by 3 digits followed by a comma followed by 4 digits • Two upper case letters followed by 3 digits • An optional exclamation point or dollar sign followed by 1 or more digits followed by an optional exclamation point or dollar sign
Circle the substrings that match the regular expression-?\d[A-Z]\D • ABC -1WX1B# -1Q Z • -1W2C%-3&-4NN
Limits of Computation • How long does it take to compute a results? • Are there problems for which no “efficient” algorithm can be created? • Are there problems for which no algorithmic solution can exist?
Limits of Computation • Polynomial time algorithm • An algorithm with an execution time that is a polynomial function of the input size • Exponential time algorithm • An algorithm with an execution time that is an exponential function of the input size • Undecidable (or non-computable) problem • A problem for which no algorithm can exist • Halting problem
Limits of Computation • Polynomial time algorithms • Linear search • N • Selection sort • N2 • Can we sort faster than N2? • MergeSort • Nlog2N