Home
Explore
Exams
Search for anything
Login
Get started
Home
Conceptual Problems on Linked Lists, Stacks, and Queues with Big O Constraints Design solutions conceptually (no code) while adhering to specific time
Conceptual Problems on Linked Lists, Stacks, and Queues with Big O Constraints Design solutions conceptually (no code) while adhering to specific time
0.0
(0)
Rate it
Studied by 0 people
View linked note
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Card Sorting
1/22
There's no tags or description
Looks like no tags are added yet.
Study Analytics
All
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
23 Terms
View all (23)
Star these 23
1
New cards
Detect Cycle in Linked List
Use Floyd’s Tortoise and Hare algorithm with two pointers to determine if a cycle exists in O(n) time and O(1) space.
2
New cards
Sort Stack with One Additional Stack
Sort a stack using a temporary stack in O(n²) time and O(n) space.
3
New cards
Reverse Queue Using Stack
Reverse the order of elements in a queue by transferring elements to a stack and back in O(n) time and O(n) space.
4
New cards
Find Middle Element in Linked List
Use two pointers to identify the middle node in O(n) time and O(1) space.
5
New cards
Check Balanced Parentheses
Use a stack to verify if parentheses are balanced in O(n) time and O(n) space.
6
New cards
Implement Queue Using Two Stacks
Design a queue using two stacks to achieve O(1) amortized time for enqueue and dequeue operations.
7
New cards
Remove Nth Node from End of Linked List
Utilize two pointers to remove the Nth node from the end in O(n) time and O(1) space.
8
New cards
Design Min Stack
Implement a stack supporting push, pop, and getMin in O(1) time per operation, using two stacks.
9
New cards
Generate Binary Numbers using Queue
Create binary numbers from 1 to N using a queue in O(n) time and O(n) space.
10
New cards
Check Palindrome in Linked List
Determine if a linked list is a palindrome by reversing the second half and comparing in O(n) time and O(1) space.
11
New cards
Evaluate Postfix Expression
Use a stack to evaluate a postfix expression in O(n) time and O(n) space.
12
New cards
Reverse First K Elements in Queue
Reverse the first K elements of a queue using a stack in O(n) time and O(K) space.
13
New cards
Flatten a Multilevel Linked List
Merge child nodes with the main list in O(n) time and O(1) space.
14
New cards
Design Browser History using Stacks
Simulate browser navigation with two stacks for visited pages and forward operations in O(1) time.
15
New cards
Merge Two Sorted Lists
Merge two sorted linked lists using a dummy node in O(n + m) time and O(1) space.
16
New cards
Validate Stack Sequences
Check if push and pop sequences are valid using a simulated stack in O(n) time and O(n) space.
17
New cards
Circular Buffer Implementation
Design a circular queue with a fixed size that supports O(1) enqueue and dequeue operations.
18
New cards
Remove Duplicates from Sorted List
Eliminate duplicates in a sorted linked list in O(n) time and O(1) space.
19
New cards
Largest Rectangle in Histogram
Find the maximum rectangle area in a histogram using a stack in O(n) time and O(n) space.
20
New cards
Interleave First and Second Halves of Queue
Split and interleave a queue’s halves in O(n) time and O(n) space.
21
New cards
Rotate List by K Places
Rotate a linked list to the right by K places in O(n) time and O(1) space.
22
New cards
Simplify File Path
Convert an absolute file path to canonical form using a stack in O(n) time and O(n) space.
23
New cards
Design Recent Calls Counter
Count requests in the last 3000 milliseconds using a queue with O(1) amortized time and O(n) space.