1/29
AP Computer Science Principles - Flashcards for Big Idea 3: Algorithms and Programming
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is an algorithm?
A set of steps to do a task.
In computer science, what are algorithms used for?
To solve a problem or complete a task.
What is data abstraction?
Information hiding, bundling related program variables together to think of data hierarchically.
What is an example of data abstraction?
A list, which is a data type that holds a collection of values.
What are variables?
Placeholders for values a program needs to use.
What are strings?
Text fields that are a series of characters denoted with quotation marks.
What is the assignment operator used for?
To assign a value to a variable.
What are expressions?
Calculations to be evaluated to an answer or single value.
What are Boolean values?
Values that can only be true or false.
Name the three types of program statements?
Sequential, Selection, and Iterative
What are iterative statements also referred to as?
Repetitive statements or loops.
What is a nested conditional?
An IF statement within another set of IF statements.
What are Lists?
A collection of items
What are individual items in a list called?
Elements
How are elements accessed?
By position using an index in square brackets [index]
What does the APPEND command do?
Adds a new element to the end of the list.
What does the REMOVE command do?
Deletes the element at the provided index position and shifts the remaining elements one position to the left.
What is traversing a list?
A loop that will automatically repeat the code for each element in the list.
What does searching deal with?
Finding the needed element from everything in the dataset or determining that it is not there.
What is a linear search?
Checking each individual record, starting at the beginning and going to the end, one after the other in order to either find the desired data or to determine it is not in the dataset.
Why are binary searches more efficient than linear searches?
The binary search is considered a “divide and conquer” algorithm because it divides the dataset into two equal parts.
What are procedures also called?
Functions in some programming languages.
What is procedural abstraction?
You only need to know the name of the procedure, the number and type of parameters, and the output to expect.
Why are random number generator programs useful?
Mainly in designing games.
What is DISPLAY()?
A built-in procedure used for this course on the exam.
What is INPUT()?
Accepts data from the user, usually from the keyboard.
What does API stand for?
Application Programming Interface.
What are simulations designed for?
To represent and mirror the real world for testing.
What does the efficiency of algorithms deal with?
Resources needed to run it in terms of how long it will take and how much memory will be needed.
What is an undecidable problem?
Does not have an algorithm that can give a correct “yes” or “no” for all cases of the problem.