when a recursive function repeatedly calls itself without ever reaching a base case or stopping condition, leading to an infinite loop and potential program crashes or unresponsiveness.
What is infinite recursion?
Add an element to an Arraylist
What is the add() method?
Building a binary heap from the input array and repeatedly extracting the maximum (or minimum) element from the heap and placing it at the end of the output array. This process continues until all the elements have been extracted and the output array is sorted.
What is heap sort?
public static int recursiveProduct(int n) {
if (n == 0) {
return 1;
} else {
return n * recursiveProduct(n-1);
}
}
What is a factorial?
ArrayList<String> myArrayList = new ArrayList<String>();
What is initializing an Arraylist of Strings?
O(n log n)
What is the time complexity of Heap Sort?