1/26
Flashcards covering key vocabulary terms and concepts from the Algorithms and Programming lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Programming Language Structures
All programming languages use similar programming structures and commands.
Big Idea 3
Focuses on the efficiency of algorithms, writing algorithms, and implementing algorithms using Pseudo-Code.
Pseudo-Code
A simple way to represent an algorithm or program, easily written and modified, and understandable by anyone.
Variable
An abstraction inside a program that can hold a value, with associated data storage representing one value at a time.
Variable Value
The most recent value assigned to a variable.
Boolean
Data type appropriate for representing true/false values.
List
An ordered sequence of elements.
String
An ordered sequence of characters.
x aList[i]
Assigns the value of aList[i] to the variable x.
aList[i] aList[j]
Assigns the value of aList[j] to aList[i].
LENGTH(aList)
Evaluates to the number of elements in aList.
INSERT (aList, i, value)
List is increased by 1, and value is placed at index i in aList.
APPEND(aList, value)
The length of aList is increased by 1, and value is placed at the end of aList.
REMOVE (aList, i)
Removes the item at index i in aList and shifts to the left any values at indices greater than i. The length of aList is decreased by 1.
APPEND(list, item)
Adds item to the end of list, increasing the length of list by 1.
INSERT(list, i, item)
Inserts the item at the 1-based index i, and shifts any items after to the right. The length of the list increases by one.
REMOVE(list, i)
Removes the item at the 1-based index i, and shifts any items after to the left. The length of the list decreases by one.
RANDOM (a, b)
Returns a random integer from a to b, including a and b. Each result is equally likely to occur.
concat(str1, str2)
Returns a single string consisting of str1 followed by str2.
prefix(str, length)
Returns the first length characters of str or str if length is greater than the number of characters in str.
substring(str, start, length)
Returns the characters with the string at start position and the given length of characters.
len(str)
Returns the number of characters in str
PROCEDURE procedureName (parameter1, parameter2,…)
Procedures are called.
Conditionals - IF and ELSE
It makes decisions using Boolean Expressions inside Conditionals statements, in other words, it can respond differently depending on the different inputs and parameters.
ELSE statement
It allows programs to execute a different set of instructions when the condition statement is FALSE.
Nested Conditionals
A programming construct where one conditional statement is embedded within another conditional statement.
Iteration-Loops
Computer program that repeats to accomplish some task.