

TSA Coding Practice Questions – Flashcardlet Format
Flashcard
•
Science
•
12th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is binary search?
Back
A search algorithm that finds the position of a target value within a sorted array. It works by repeatedly dividing the search interval in half.
2.
FLASHCARD QUESTION
Front
What is the time complexity of binary search?
Back
O(log n), where n is the number of elements in the array.
3.
FLASHCARD QUESTION
Front
What is an infinite loop?
Back
A loop that continues to execute indefinitely because the terminating condition is never met.
4.
FLASHCARD QUESTION
Front
What is a while() loop used for?
Back
To execute a block of code repeatedly as long as a specified condition is true.
5.
FLASHCARD QUESTION
Front
What does RANDOM(1,5) return?
Back
A random integer between 1 and 5, inclusive.
6.
FLASHCARD QUESTION
Front
How do you stop a loop when two conditions are met?
Back
Use a conditional statement that checks both conditions, e.g., 'when (die1 == 3 && die2 == 3) {'.
7.
FLASHCARD QUESTION
Front
What is the difference between a while loop and a repeat-until loop?
Back
A while loop checks the condition before executing the loop body, while a repeat-until loop checks the condition after executing the loop body.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?