ArrayList in AP Computer Science A
If you need to frequently check if values are contained within a dataset while keeping it sorted at all times, what data structure should you ideally use?
ArrayList
Hashtable
HashMap
TreeSet
What advantage does bubble sort offer over quicksort when considering the stability of sorting algorithms?
Bubble sort maintains the relative order of equal elements while sorting
Bubble Sort operates more efficiently in distributed systems compared to quicksort
Bubble sort has a faster worst-case runtime than quicksort's
Bubblesort uses less memory than quicksort during execution
Before an algorithm represents a suitable choice for real-time processing application?
Radix sort
Merge sort
Quick sort
Heap sort
What is the purpose of using a breakpoint in debugging?
To terminate the program immediately.
To skip over certain parts of code during execution.
To pause program execution and inspect values at a specific line.
To compile the program with optimizations for speed.
Which sorting algorithm is typically best suited for small datasets due to its simple implementation but less efficient for large datasets because of its quadratic time complexity?
Merge sort.
Bubble sort.
Heap sort.
Quick sort.
How does selection sort work?
It divides the ArrayList into a sorted subarray and an unsorted subarray, selecting the smallest element and swapping it with the first element
It compares adjacent elements and swaps them if they are in the wrong order
It selects the largest element and moves it to the end of the ArrayList
It randomly shuffles the elements in the ArrayList
Which sorting algorithm divides the ArrayList into a sorted subarray and an unsorted subarray?
Insertion sort
Quick sort
Selection sort
Merge sort

How are we doing?
Give us your feedback and let us know how we can improve
In which scenario would you not use a sorting algorithm?
When accessing elements by index in an array.
Before searching for an element using binary search.
When ordering names alphabetically in a list.
To display scores from highest to lowest on a leaderboard.
Which term refers to the process of organizing data in a particular order?
declaring
sorting
encoding
looping
When would you typically use step-over in debugging?
To rerun the entire program from the start.
To jump back to previous lines of code before a breakpoint.
To execute code line by line without stepping into functions.
To change variable values while running the code.