Unit 1 - Section 2 Flashcards
Pseudocode
A set of English language constructs designed to resemble statements in a programming language but that do not actually run on a computer.
Sequential Operations in Pseudocode
Pseudocode must include instructions to carry out the three basic sequential operations computation, input and output.
Computation
Set the value of a “ variable” to “ arithmetic expression”
Variable
A named stored location that can hold a data value.
Input and Output
Enables the computing agent to communicate with the outside world,
Input => Get values for variable
Output => Print the values of variable
Sequential Algorithm ( Or straight-line algorithm)
executes its instructions in a straight line from top to bottom and then stops.
Control Operations
Allow us to alter the normal sequential flow of control in an algorithm
Looping operations reminds
Operations within the loop body should be indented so that it is clear to the reader of the algorithm which operations belong inside the loop
Infinite loop
When a continuation condition never becomes false
Pretest loop
the continuation condition is tested at the beginning of each pass through the loop, and therefore it is possible for the loop to never be executed.
Posttest loop
The test is done at the end of the loop body. The loop is typically expressed using the do/while statement.
Algorithm discovery
Finding a solution to a given problem
Sequential Search
is the standard algorithm for searching an unordered list of values
Selecting an algorithm to solve a problem
greatly influence by the way the input data for that problem are organized
Library
A collection of useful, prewritten algorithms. An important tool in the design and development of algorithms.