CSCI 1112 Lecture Notes - Lecture 2: Pseudocode, List Of Algorithms, Bubble Sort
Document Summary
Expressing algorithms: we express algorithms in whatever way is the clearest and most concise. English is sometimes the best way: to make algorithms perfectly clear, we will use pseudocode. In the lab, you will transform pseudocode into java. Analyzing algorithms: we want to predict the resources that any algorithm requires. In order to predict resource requirements, we need a computational model. In our case is the ram computational model. Ram (random access machine) model: any data in memory can be accessed at any time. No concurrent operations: we"ll use i(cid:374)st(cid:396)u(cid:272)tio(cid:374)s (cid:272)o(cid:373)(cid:373)o(cid:374)ly fou(cid:374)d i(cid:374) (cid:396)eal computers: Control: conditional/unconditional branch: each of these instructions take a constant amount of time. Does not depend on how big the numbers are: the ram model uses both integer and floating-point types. Running time: the time taken by an algorithm depends on the input. Sorting 1000 numbers takes longer than soring 3 numbers.