







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








โ equality operator Answer: (==) evaluates to true if the left side and right side are equal โ nested branches Answer: Branches that can take on various forms, and the if-else branches may even use different variables. โ multiple if branches Answer: each decision is independent, and thus more than one branch can execute, in contrast to the if-elseif arrangement where only one branch can execute. โ != Answer: not equal โ Relational Operators
Answer: Used to compare two values. Operators include =,<,>,<=,>=,<> โ logical operator Answer: Treats operands as being true or false, and evaluates to true or false; includes: and, or, not; โ implicitly vs explicitly Answer: no gaps = implicitly gaps = explicitly โ epsilon Answer: The difference threshold indicating that floating-point numbers are equal; its value depends on the program's expected values, commonly 0. โ nested branches Answer: โ loop Answer: a program construct that repeatedly executes the loop's statements (known as the loop body) while the loop's expression is true; when false, execution proceeds past the loop.
โ while loop Answer: a programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is true โ for loop Answer: type of loop that contains a loop variable initialization, a loop expression, and a loop variable update that typically describes iterating for a specific number of times. โ nested loop Answer: A loop inside the body of another loop; commonly referred to as inner loop and outer loop โ inner loop Answer: for loop that handles the printing of the asterisks โ outer loop Answer: while loop that handles executing until a negative number is entered โ do-while loop Answer: first executes the loop body's statements, then checks the loop condition
โ vector Answer: construct similar to an array โ element Answer: each item in an array is known as... โ index Answer: each element's location number is called the... ; myArray[2] has an index 2; usually will start with 0 instead of 1: myArray[0], myArray[1], myArray[2]... โ swapping Answer: two variables swap value; e.g. x = 55 and y = 7 --> x = 7 and y = 55; typically will need a third variable (tmpVal) to hold one of the values while the swap occurs โ function is a ___ Answer: named list of statements; function definition, function call, local variable โ function definition
โ return variable Answer: A function may return one value and does so by assigning a return variable with the return value. โ Modular development Answer: The process of dividing a program into separate modules that can be developed and tested separately and then integrated into a single program. โ function stub Answer: a function definition whose statements have not yet been written โ function definition begins with ___ Answer: begins with word "Function," the function's name, and a list comma-separated parameters (if any) in parentheses, and a return indication โ return statement Answer: explicitly returns the specified value and immediately exits the function โ algorithm time efficiency
Answer: number of calculations it takes to solve a problem in an algorithm โ linear Answer: type of algorithm that starts at the beginning and checks each item until found; search may be slow โ binary Answer: type of algorithm that checks range's middle; if value is greater, will search in upper half and vice versa; essentially looking at half the data not all of it; can be faster than linear (e.g. used with search engines) โ computational problem Answer: specifies an input, a question about the input that can be answered using a computer, and the desired output. โ longest common substring Answer: type of algorithm that determines the longest common substring that exists in two inputs strings (e.g. used for DNA analysis) โ Dijsktra's shortest path
โ best case Answer: scenario where the algorithm does the minimum possible number of operations (can not be zero, though) โ worst case Answer: scenario where algorithm does the maximum possible number of operations (could be last number in a list or a number that is not on the list) โ space complexity Answer: a function, S(N), that represents the number of fixed-size memory units used by the algorithm for an input of size N; includes input data and additional memory allocated by the algorithm โ auxiliary space complexity Answer: space complexity not including the input data (essentially removes the N from the equation) โ "on the order" of N things Answer: linear search requires at most N comparisons... โ sorting
Answer: process of converting a list of elements in ascending or descending order; a lot of times will involve swapping values in an algorithm โ heuristic Answer: A technique that willingly accepts a non-optimal or less accurate solution in order to improve execution speed โ 0 - 1 knapsack problem Answer: problem with the quantity of each item limited to 1 โ heuristic algorithm Answer: algorithm that determines a near optimal or approximate solution; can be used to solve 0-1 knapsack problem โ Systems of Development Life Cycle Answer: SDLC; analysis phase, design phase, implementation phase, testing phase โ analysis phase Answer: phase that identifies a program's goals โ design phase
encapsulation) [e.g. when you use an oven, you turn a knob or hit some buttons...you are not dealing with internal parts of oven) โ abstract data type Answer: ADT; data type whose creation and update are constrained to specific well-defined operations โ universal modeling langauge Answer: UML; modeling language for software design that uses different types of diagrams to visualize the structure and behavior of programs; structural, behavioral, and activity diagrams are examples โ structural diagram Answer: diagram that visualizes static elements of software; such as types of variables and functions used in a program