What is an algorithm?
An algorithm is a finite, ordered procedure that specifies inputs, processing steps, outputs, termination, and correctness.
Study 01. Introduction to Programming and Algorithmic Problem Solving with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is an algorithm?
An algorithm is a finite, ordered procedure that specifies inputs, processing steps, outputs, termination, and correctness.
How does a program differ from an algorithm?
A program is a concrete implementation of an algorithm using the formal rules of a particular programming language.
What determines whether code has valid form?
Syntax is the grammar of a programming language: the rules that determine whether code has a valid form.
What is control flow?
Control flow is the order in which program statements execute. Sequences, conditionals, loops, and function calls shape that order.
What is a variable?
A variable is a named reference to a value; assignment gives it a value or changes the value it refers to.
What value does a Boolean expression produce?
A Boolean expression evaluates to True or False and is commonly used to control program flow.
When is p and q true?
The expression p and q is true only when both p and q are true.
What is a function?
A function is a named, reusable block of code that may accept parameters and produce an output with return.
What is decomposition in problem solving?
Decomposition breaks a task into smaller operations, reducing cognitive complexity and often suggesting useful functions.
What is the purpose of testing?
Testing compares a program’s actual behavior with expected behavior using normal, boundary, special, and invalid cases.
What prerequisite does binary search have?
Binary search requires sorted input because it uses ordering to eliminate half of the remaining search range after each comparison.
What is binary search’s worst-case time complexity?
Binary search has worst-case running time O(log n), because it approximately halves the remaining search range at every iteration.