This is the time complexity to access an element in an array by index.
What is O(1)?
This keyword is used to define a constant variable in Java.
What is final?
This is the time complexity to insert a node at the head of a singly linked list.
What is O(1)?
This simple sorting algorithm repeatedly swaps adjacent elements if they are in the wrong order.
What is Bubble Sort?
This algorithm finds the shortest path in an unweighted graph using a queue.
What is Breadth-First Search (BFS)?
This technique uses two indices moving toward each other, often used in sorted arrays to find pairs.
What is the two-pointer technique?
This type of class cannot be instantiated and may contain abstract methods.
What is an abstract class?
This algorithm detects a cycle in a linked list using two pointers moving at different speeds.
What is Floyd’s Cycle Detection Algorithm (Tortoise and Hare)?
This divide-and-conquer algorithm splits the array and merges sorted halves.
What is Merge Sort?
This algorithm finds the shortest path in a weighted graph with non-negative weights.
What is Dijkstra’s Algorithm?
This algorithm finds the maximum sum of a contiguous subarray in linear time.
What is Kadane’s Algorithm?
These are the 8 built-in primitive data types in Java.
What are byte, short, int, long, float, double, char, boolean?
This operation reverses a singly linked list iteratively.
What is reversing pointers using prev, current, next?
This is the average time complexity of QuickSort.
What is O(n log n)?
This algorithm can handle negative weights and detects negative cycles.
What is Bellman-Ford Algorithm?
This in-place algorithm rotates an array to the right by k steps using reversal.
What is the array reversal algorithm (reverse parts then whole)?
This is the difference between == and .equals() when comparing objects.
What is reference comparison vs value/content comparison?
This technique finds the middle node of a linked list in one pass.
What is the slow and fast pointer technique?
This sorting algorithm builds a heap and repeatedly extracts the maximum element.
What is Heap Sort?
This algorithm computes shortest paths between all pairs of nodes.
What is Floyd-Warshall Algorithm?
This is the optimal time complexity to find the median of two sorted arrays.
What is
O(log(min(n, m)))?
This concept allows a variable to refer to objects of different types at runtime.
What is polymorphism?
This is the time complexity to find the kth node from the end using two pointers.
What is O(n)?
This is the worst-case time complexity of QuickSort when the pivot selection is poor.
What is O(n²)?
This technique improves Dijkstra by using heuristics to guide the search toward the goal.
What is the A* (A-star) algorithm?