Why do we drop constant factors and keep only the dominant term when analyzing Big-O complexity?
Rank these complexities from fastest to slowest: O(n), O(1), O(n²), O(2ⁿ), O(n log n).
Why does accessing an element by index in an array take O(1) time?
What does Big-O notation measure, and why is it useful for comparing algorithms?
How do dynamic arrays achieve amortized constant-time appends despite fixed memory allocation?
What is the key tradeoff between arrays and linked lists in terms of access and modification?
Why does inserting an element in the middle of an array take O(n) time?
Why can linked lists insert and delete elements in constant time while arrays cannot?
What is the key difference between a singly linked list and a doubly linked list?
How do push and pop operations compare in terms of time complexity, and what is their practical significance?
What is the fundamental difference between a stack and a queue in terms of element ordering?
How can stacks be used to solve the bracket balancing problem?
Why is handling collisions critical in hash table implementation, and what are two common strategies?
How does a priority queue differ from a standard queue in terms of element removal?
What is the average time complexity for insertion, deletion, and lookup in a hash table, and what does it depend on?
What is the difference between a queue and a deque in terms of insertion and removal operations?
Why is rehashing necessary when a hash table's load factor becomes too high?
What is the purpose of self-balancing trees like AVL and red-black trees?
What is the key difference between chaining and open addressing as collision resolution strategies in hash tables?
What happens to the time complexity of BST operations when the tree becomes unbalanced, and what causes this degradation?
Why does the ordering property of a binary search tree enable efficient search operations?
What is the key difference between a max-heap and a min-heap in terms of parent-child relationships?
How do the time complexities of simple sorting algorithms (bubble sort, selection sort, insertion sort) compare to more advanced algorithms like heapsort?
Why are self-balancing trees like AVL trees and red-black trees preferred over regular binary search trees?
What are the time complexities for the three main heap operations?
What is the key difference between linear search and binary search in terms of requirements and speed?
Why does merge sort have better worst-case performance than quicksort, and what is the tradeoff?
What is a stable sorting algorithm, and why might this property matter?
What two essential components must every recursive solution include?
How do breadth-first search (BFS) and depth-first search (DFS) differ in their exploration strategies?
Why might deep recursion be problematic, and what types of problems are naturally suited to recursion?
What are the two essential components that every recursive solution must have?
What is the time complexity of both BFS and DFS, and what do V and E represent?
Which common graph traversal algorithms achieve O(V + E) time complexity?
What is the time complexity of an algorithm that visits each vertex and edge once in a graph?
Why is O(V + E) considered an efficient time complexity for graph algorithms?
Order these complexities from fastest to slowest: O(n log n), O(1), O(2^n), O(n), O(log n), O(n²)
When simplifying Big-O complexity, what should you do with constant factors and non-dominant terms?
What does Big-O notation primarily describe, and why is it useful for comparing algorithms?
Why does array element access by index achieve O(1) time complexity?
What is the key advantage of linked lists over arrays for insertion and deletion operations?
What is the time complexity tradeoff between arrays and linked lists for element access?
How do dynamic arrays solve the problem of fixed-size arrays, and what time complexity do they achieve for appends?
What is the fundamental difference between a stack and a queue in terms of element access order?
What is the key difference between a singly linked list and a doubly linked list in terms of structure and capability?
How does a stack's LIFO property make it useful for checking balanced brackets?
What is the time complexity of push and pop operations in a stack, and why?
What is the key difference between a priority queue and a standard queue?
How do enqueue and dequeue operations work in a queue, and what is their time complexity?
What is the difference between a regular queue and a deque?
How does a hash table achieve O(1) average time complexity, and what problem does it face?
What problem can occur in a binary search tree if it becomes unbalanced, and what is its performance consequence?
Why does a balanced binary search tree achieve O(log n) time complexity for search, insertion, and deletion operations?
How do self-balancing trees like AVL trees and red-black trees maintain better performance compared to standard BSTs?
What role does the load factor play in hash table management?
What is the key difference between a max-heap and a min-heap in terms of the heap property?
Why are self-balancing trees like AVL trees and red-black trees preferred over unbalanced binary search trees?
What are the time complexities for insertion, deletion, and root access in a heap?
Why are simple sorting algorithms like bubble sort, selection sort, and insertion sort considered impractical despite being easy to understand?
How does merge sort achieve O(n log n) time complexity, and what is its trade-off?
Why might quicksort degrade to O(n²) time complexity despite averaging O(n log n)?
What makes binary search more efficient than linear search, and what prerequisite does it require?
What does it mean for a sorting algorithm to be stable?
How does breadth-first search (BFS) differ from depth-first search (DFS) in terms of exploration strategy and data structure used?
What is a key advantage of BFS for finding paths in graphs, and what type of graph must it be?
What is a potential drawback of using recursion for solving problems, and why does it occur?
Why is O(V + E) considered efficient for graph algorithms?
What does Big-O notation represent, and why is it useful for comparing algorithms?
Why do we drop constant factors and lower-order terms when expressing Big-O complexity?
What is the difference between time complexity and space complexity?
How do dynamic arrays like Python lists overcome the fixed-size limitation of traditional arrays?
What is the key tradeoff between arrays and linked lists regarding element access and insertion?
Why can linked lists perform insertion and deletion in constant time while arrays cannot?
Why are push and pop operations on a stack more efficient than operations on a linked list?
How does a stack's LIFO property make it suitable for managing function calls?
What is the fundamental difference between a stack and a queue in terms of element removal?
What is the difference between a regular queue and a priority queue?
What is a collision in a hash table and what are two strategies to handle it?
What is the average time complexity for insertion, deletion, and lookup in a hash table?
Why does the ordering property of a binary search tree enable efficient operations?
What is the worst-case time complexity for operations on an unbalanced BST and what causes this degradation?
How do self-balancing trees like AVL and red-black trees improve upon standard binary search trees?
What triggers a resize operation in a hash table and why is rehashing necessary?
What is the key difference between a max-heap and a min-heap?
Why are self-balancing trees like AVL trees and red-black trees important for tree performance?
Why are simple sorting algorithms like bubble sort and selection sort considered impractical for large datasets?
Why does merge sort require O(n) extra space while achieving O(n log n) time complexity?
What is the key difference between quicksort's average and worst-case time complexity, and what causes the worst case?
When would you choose binary search over linear search, and what is the prerequisite?
What does it mean for a sorting algorithm to be stable, and why might this matter?
What are the two essential components required in any recursive solution?
How does breadth-first search (BFS) differ from depth-first search (DFS) in their exploration strategy?
Why is BFS preferred over DFS when finding the shortest path in an unweighted graph?
What is the time complexity of a graph traversal algorithm that visits each vertex and edge once?
Why is the time complexity of standard graph traversals expressed as O(V + E) rather than O(V × E)?