FIB Step by step process that describes how to solve a problem in a way that always gives a correct answer algorithm FIB A diagram with boxes connected by arrows to give the layout of a program or algorithm. flow chart SR 3 components that are needed in any programming language "loops (repetition), if's (conditional, aka selection), sequential execution (doing code in order) " FIB "Code that gives the logic of a program and has some rules about what is allowed, but is not a formal programming language and is not intended to be executed on a computer. This style of code is used to develop the logic of a program before putting it into a real programming language." pseudocode FIB "A formal language, which comprises a precise set of instructions that can be executed by a computing device." programming language FIB "Type of reasoning that follows precise mathematical rules to mathematically prove statements. In the context of computer programming, BLANK reasoning is used to prove properties of programs (correctness, running ime)." formal reasoning formal FIB What is the name given for how much time or how many steps it takes an algorithm to complete? running time FIB Type of analysis of programs where the programs are run on test inputs to check that the program behaves as desired on these test inputs. BLANK analysis empirical analysis empyrical FIB Search algorithm that looks for a desired element by looking at each item one at a time in sequence. linear search linear FIB What is the worst-case big-O running time of linear search when searching for an item among n items? n O(n) FIB What is the best-case big-O running time of linear search when searching for an item among n items? 1 O(1) constant FIB "Search algorithm that only works on already sorted data, starts by checking the element in the middle of the list and recursively checks either the first half or second half of the list based on this comparison." binary search binary FIB What is the big-O running time of binary search when searching in a list that has n items? log(n) O(log(n) log n O(log n) FIB "Sorting algorithm that works by finding the smallest item and putting it first, then finding the second smallest and putting it second, and so on." selection sort selection FIB What is the worst-case big-O running time of selection sort when sorting a list of n numbers? n squared O(n**2) n**2 O(n^2) n^2 quadratic FIB What is the best-case big-O running time of selection sort when sorting a list of n numbers? n squared O(n**2) n**2 O(n^2) n^2 quadratic FIB "What is the term for the type of running time when we are talking about the ""typical"" running time of the algorithm? BLANK running time." average-case running time average-case average case average case running time FIB What is the term for the type of running time when we are talking about the best possible running time of the algorithm? BLANK running time. best-case running time best-case best case running time best case FIB What is the term for the type of running time when we are talking about the worst possible running time of the algorithm? BLANK running time. worst-case running time worst-case worst case running time worst case FIB What is the value of log2(1024)? 10 FIB What is the value of 2**10 1024 FIB "What is the name for a running time that grows faster than n, faster than n**2, and faster than any polynomial" super-polynomial running time super-polnomial super polynomial super polynomial running time super-polynomial time super polynomial time FIB "What is the name for a running time that grows as fast as c**n for some constant c > 1 (e.g., 2**n or 10**n)?" exponential running time exponential exponential time FIB "What is the name that is true of all of the following running times: n, n**2, n**3?" polynomial running time polynomial FIB What is the name for the type of algorithm whose behavior is not guaranteed but will often perform well? This could be in terms of correctness or running time. BLANK algorithm. heuristic algorithm heuristic MC "If an algorithm consists of a single for loop with some setup code before the loop, some conditional logic in the loop, and some code to print results after the loop, which kind of running time does the algorithm probbly have?" exponential incorrect linear correct quadratic incorrect logarithmic incorrect MC "If an algorithm consists of a two nested for loops with some setup code before the loops, some conditional logic in the loops, and some code to print results after the loops, which kind of running time does the algorithm probably have?" exponential incorrect linear incorrect quadratic correct logarithmic incorrect MC "If an algorithm works by trying all possible combinations of whatever it is working with, what kind of running time does the algorithm probably have?" exponential correct linear incorrect quadratic incorrect logarithmic incorrect SR "Binary search and linear search are two different algorithms for finding items in a list. Describe (a) a situation where binary search would b better to use, and why, and (b) a situation where linear search would be better to use and why." FIB "If an algorithms takes the same number of operationsno matter what input it is given (e.g., no matter how many numbers in a list), what is the running time of the algorithm called? BLANK time." constant constant time O(1) FIB "What is the name of the computational problem that asks for the fastest route that starts at a point, travels through a list of destination, and returns to the starting point?" traveling salesperson problem traveling salesperson TSP FIB What is the name of the computational problem that asks to optimize the value of items that can be put into a given container? knapsack problem knapsack FIB What is the name to describe a computational problem such that any algorithm trying to solve the problem makes some mistakes? BLANK problem. undecidable undecidable problem FIB What is the name of the computational problem that asks if a given program will halt or go into an infinite loop or infinite recursion? halting problem