AP Computer Science & Technology Flashcards
6 cards from real AP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 AP Computer Science & Technology flashcards as text
In AP Computer Science, which data structure operates on a Last-In-First-Out (LIFO) principle?
Answer: Stack
A stack uses LIFO, meaning the last element added is the first one removed.
What is the time complexity of a binary search algorithm on a sorted array of n elements?
Answer: O(log n)
Binary search halves the search space each step, resulting in O(log n) time complexity.
Which of the following best describes an algorithm with O(n²) time complexity?
Answer: Quadratic time
O(n²) is called quadratic time because execution time grows as the square of the input size.
In AP Computer Science Principles, what does abstraction allow programmers to do?
Answer: Manage complexity by hiding unnecessary details
Abstraction lets programmers manage complexity by focusing on essential features and hiding implementation details.
What is a Boolean expression?
Answer: An expression that returns true or false
A Boolean expression evaluates to either true or false and is fundamental to conditional logic in programming.
Which of the following describes a recursive function?
Answer: A function that calls itself
A recursive function calls itself with a modified argument until a base case terminates the recursion.