Unit 4 Flashcards
(30 cards)
Sequence
a control structure in which a set of instructions is executed once in the order that they were written
Assignment
giving a variable a value
Selection
a control structure in which an option of various statements is provided and a variable is used to decide which statements (if any) are executed
Iteration (Repetition)
a control structure in which a group of statements is executed repeatedly until a condition is met
definite vs indefinite iteration
definite gets repeated a certain number of times, indefinite until a condition is met
Representational Abstraction
a representation arrived at by removing unnecessary details
information hiding
hiding all details of an object that do not contribute to its essential characteristics.
Representational Abstraction
representational abstraction is a representation arrived at by removing unnecessary details (creating a model)
Abstraction by generalisation
a grouping by common characteristics to arrive at a hierarchical relationship of the ‘is a kind of’ type, used a lot in OOP
Procedural Abstraction
Where the particular processes of a computational method is hidden, abstracting it into a procedure
Functional abstraction
abstracts it into a function
Data abstraction
details of how data are actually represented are hidden, allowing new kinds of data objects
Composition abstraction
opposite of Decomposition, usually built by combining procedures to form compound procedures or by combining data objects to form compound data
regular expression
a way of describing a set of data or a pattern of data
regular language
can be represented by a regular expression
Metacharacters
the characters used in regular expression
*
0 or more repetitions of the preceding element
+
1 or more repetitions of the preceding element
?
0 or 1 repetitions of the preceding element
|
or for regular expressions
Backus-Naur Form
somewhat like regular expression but recursive, make statement to say it can be +|-
Tractable
problems that have a polynomial (or less) time solution are called tractable problems
Intractable
problems that can be solved BUT have no polynomial (or less) time solution are called intractable problems; the solution is exponential time or worse
Heuristic methods
are often used when tackling intractable problems