zuai-logo
  • Home

  • Mock Exam

  • Cliffs

  • Study Set

  • Talk to ZuAI

  • Request a Feature

zuai-logo
  1. AP Computer Science Principles
FlashcardFlashcard
Study GuideStudy GuideQuestion BankQuestion Bank

What are the differences between linear and binary search?

Linear: Checks each element sequentially, works on unsorted data | Binary: Requires sorted data, eliminates half the data with each step.

Flip to see [answer/question]
Flip to see [answer/question]
Revise later
SpaceTo flip
If confident

All Flashcards

What are the differences between linear and binary search?
Linear: Checks each element sequentially, works on unsorted data | Binary: Requires sorted data, eliminates half the data with each step.
What are the differences between parameters and arguments?
Parameters: Variables in procedure definition | Arguments: Values passed when calling the procedure.
What are the differences between reasonable and unreasonable time complexity?
Reasonable: Polynomial or lower | Unreasonable: Exponential or factorial.
What are the differences between decidable and undecidable problems?
Decidable: An algorithm can always find a solution | Undecidable: No algorithm can always find a solution.
What are the steps of binary search?
1. Sort the data. 2. Find the middle element. 3. Compare target to middle. 4. Eliminate half the data. 5. Repeat until found or exhausted.
What is a Variable?
A named storage location in memory.
What are Data Types?
Categories of values (e.g., integer, string, boolean).
What is a List?
An ordered collection of elements.
What is an Element?
An individual value in a list.
What is an Index?
The position of an element in a list.
What is an Algorithm?
A step-by-step procedure for solving a problem.
What is Sequencing?
Executing code statements in order.
What is a Boolean Value?
A value that is either `true` or `false`.
What is Iteration?
Repeating a block of code.
What is a Procedure?
A named block of code that performs a specific task.