13 views
22 Dec 2025
Perform inorder, preorder, and postorder traversals of a binary tree....
14 views
22 Dec 2025
Traverse a binary tree level by level using a queue....
10 views
22 Dec 2025
Find the height of a binary tree using recursion....
13 views
22 Dec 2025
Count the total number of nodes in a binary tree....
14 views
22 Dec 2025
Count the number of leaf nodes in a binary tree....
12 views
22 Dec 2025
Convert a binary tree into its mirror image....
15 views
22 Dec 2025
Find the diameter (longest path) of a binary tree....
12 views
22 Dec 2025
Check whether a binary tree is height-balanced....
18 views
22 Dec 2025
Find the lowest common ancestor of two nodes in a binary tree....
17 views
22 Dec 2025
Explain properties of a Binary Search Tree....
13 views
22 Dec 2025
Search for a value in a Binary Search Tree....
16 views
22 Dec 2025
Insert a new node into a Binary Search Tree....
17 views
22 Dec 2025
Delete a node from a Binary Search Tree while maintaining its properties....
16 views
22 Dec 2025
Check whether a given binary tree is a valid Binary Search Tree....
15 views
22 Dec 2025
Find the kth smallest element in a Binary Search Tree....
13 views
22 Dec 2025
Convert a sorted array into a height-balanced Binary Search Tree....
16 views
22 Dec 2025
Perform boundary traversal of a binary tree....
19 views
22 Dec 2025
Print the vertical order traversal of a binary tree....
14 views
22 Dec 2025
Explain what a tree data structure is and how it differs from linear data structures....
13 views
22 Dec 2025
Explain different types of trees such as binary tree, binary search tree, AVL tree, and heap....
15 views
22 Dec 2025
Explain what a stack data structure is and how it follows the LIFO principle....
15 views
22 Dec 2025
Explain basic stack operations such as push, pop, peek, and isEmpty....
10 views
22 Dec 2025
Implement a stack using an array and explain how overflow and underflow occur....
15 views
22 Dec 2025
Implement a stack using linked list and explain dynamic memory usage....
11 views
22 Dec 2025
Check whether an expression has balanced parentheses using stack....
12 views
22 Dec 2025
Reverse a string using stack and explain the process step by step....
12 views
22 Dec 2025
Convert an infix expression to postfix using stack....
12 views
22 Dec 2025
Evaluate a postfix expression using stack....
10 views
22 Dec 2025
Find the next greater element for each element in an array using stack....
13 views
22 Dec 2025
Find the previous smaller element for each element using stack....
13 views
22 Dec 2025
Solve the stock span problem using stack and explain the logic....
14 views
22 Dec 2025
Find the largest rectangular area in a histogram using stack....
14 views
22 Dec 2025
Implement a queue using stack and explain the approach....
13 views
22 Dec 2025
Implement a stack using queue and explain the approach....
13 views
22 Dec 2025
Check whether a string is palindrome using stack....
13 views
22 Dec 2025
Sort a stack using recursion or another stack....
14 views
22 Dec 2025
Design a stack that supports getMin operation in O(1) time....
9 views
22 Dec 2025
Remove adjacent duplicate characters from a string using stack....
14 views
22 Dec 2025
Decode an encoded string using stack....
15 views
22 Dec 2025
Find the celebrity in a party using stack approach....
14 views
22 Dec 2025
Sort an array using Bubble Sort and explain how adjacent elements are repeatedly swapped to move the largest element to the end....
14 views
22 Dec 2025
Sort an array using Selection Sort by repeatedly selecting the minimum element and placing it at the correct position....
15 views
22 Dec 2025
Sort an array using Insertion Sort and explain how elements are inserted into their correct position....
15 views
22 Dec 2025
Sort an array using Merge Sort by dividing the array into halves and merging sorted subarrays....
13 views
22 Dec 2025
Sort an array using Quick Sort and explain pivot selection and partitioning....
14 views
22 Dec 2025
Sort an array using Heap Sort and explain heap construction and extraction....
13 views
22 Dec 2025
Sort elements using Counting Sort when the range of input values is known....
13 views
22 Dec 2025
Sort numbers using Radix Sort by processing digits from least to most significant....
13 views
22 Dec 2025
Sort elements by distributing them into buckets and sorting each bucket individually....
11 views
22 Dec 2025
Sort an array using Shell Sort and explain gap reduction....
11 views
22 Dec 2025
Explain Tim Sort algorithm used in Python and Java and why it is efficient in practice....
15 views
22 Dec 2025
Differentiate between stable and unstable sorting algorithms with examples....
11 views
22 Dec 2025
Explain in-place sorting algorithms and their advantages....
12 views
22 Dec 2025
Sort an array where each element is at most k positions away from its sorted position....
17 views
22 Dec 2025
Sort an array containing only 0s, 1s, and 2s using the Dutch National Flag algorithm....
15 views
22 Dec 2025
Merge two already sorted arrays into a single sorted array efficiently....
15 views
22 Dec 2025
Count the number of inversions in an array using a modified merge sort....
13 views
22 Dec 2025
Find the minimum number of swaps required to sort an array....
15 views
22 Dec 2025
Find the kth smallest element in an unsorted array using sorting or selection techniques....
13 views
22 Dec 2025
Sort an array of strings in lexicographical order using suitable sorting approach....
16 views
22 Dec 2025
Search for an element in an array by checking each element sequentially and explain when this approach is useful....
11 views
22 Dec 2025
Search for an element in a sorted array by repeatedly dividing the search space into halves....
14 views
22 Dec 2025
Implement binary search using an iterative approach and explain its working....
19 views
22 Dec 2025
Implement binary search using recursion and explain the recursive flow....
11 views
22 Dec 2025
Search for a target element in a rotated sorted array using modified binary search....
16 views
22 Dec 2025
Find the first and last occurrence of a target element in a sorted array....
15 views
22 Dec 2025
Count the number of occurrences of an element in a sorted array using binary search....
16 views
22 Dec 2025
Find a peak element in an array where an element is greater than its neighbors....
19 views
22 Dec 2025
Search an element in a sorted array using jump search technique....
16 views
22 Dec 2025
Search for an element in a sorted uniformly distributed array using interpolation search....
16 views
22 Dec 2025
Search for an element in a sorted array using exponential search followed by binary search....
13 views
22 Dec 2025
Find the maximum or minimum of a unimodal function using ternary search....
17 views
22 Dec 2025
Search for an element in an infinite sorted array by expanding search range....
21 views
22 Dec 2025
Search an element in a nearly sorted array where elements may be misplaced by one index....
15 views
22 Dec 2025
Find the lower bound of a target element in a sorted array....
16 views
22 Dec 2025
Find the upper bound of a target element in a sorted array....
18 views
22 Dec 2025
Search an element in a bitonic array using binary search variants....
15 views
22 Dec 2025
Find the integer square root of a number using binary search....
15 views
22 Dec 2025
Allocate minimum number of pages to students using binary search on answer....
21 views
22 Dec 2025
Place cows in stalls such that minimum distance is maximized using binary search on answer....
14 views
22 Dec 2025
Explain what a queue data structure is and how it follows the FIFO principle....
13 views
22 Dec 2025
Explain different types of queues such as simple queue, circular queue, priority queue, and deque....
12 views
22 Dec 2025
Implement a queue using an array and explain enqueue and dequeue operations....
14 views
22 Dec 2025
Implement a queue using linked list and explain how pointers are managed....
13 views
22 Dec 2025
Explain circular queue and how it overcomes limitations of simple queue....
14 views
22 Dec 2025
Explain enqueue operation in a queue with step-by-step process....
12 views
22 Dec 2025
Explain dequeue operation in a queue and how underflow is handled....
14 views
22 Dec 2025
Explain the role of front and rear pointers in queue operations....
15 views
22 Dec 2025
Explain queue overflow and underflow conditions with examples....
12 views
22 Dec 2025
Explain priority queue and its real-world applications....
12 views
22 Dec 2025
Explain deque and its operations at both ends....
13 views
22 Dec 2025
Implement a stack using queue and explain the logic....
15 views
22 Dec 2025
Implement a queue using stack and explain the approach....
15 views
22 Dec 2025
Reverse the elements of a queue using recursion or stack....
13 views
22 Dec 2025
Design a queue using circular array with proper conditions....
13 views
22 Dec 2025
Find the first non-repeating character in a stream of characters using queue....
11 views
22 Dec 2025
Find the maximum element in every sliding window using deque....
12 views
22 Dec 2025
Interleave the first half and second half of a queue....
12 views
22 Dec 2025
Generate binary numbers from 1 to N using queue....
15 views
22 Dec 2025
Explain how queue concept is used in LRU cache design....
13 views
22 Dec 2025
Explain what a linked list is and how it differs from an array in terms of memory and operations....
13 views
22 Dec 2025
Explain different types of linked lists such as singly, doubly, and circular linked lists....
13 views
22 Dec 2025
Traverse a singly linked list and explain how nodes are accessed sequentially....
13 views
22 Dec 2025
Insert a new node at the beginning of a singly linked list and explain pointer changes....
15 views
22 Dec 2025
Insert a node at the end of a linked list and describe the steps involved....
10 views
22 Dec 2025
Insert a node at a specific position in a linked list....
18 views
22 Dec 2025
Delete the first node of a linked list and explain memory handling....
16 views
22 Dec 2025
Delete the last node of a linked list and explain traversal logic....
12 views
22 Dec 2025
Delete a node containing a specific value from a linked list....
15 views
22 Dec 2025
Search for an element in a linked list and return its position....
12 views
22 Dec 2025
Reverse a singly linked list iteratively and explain pointer manipulation....
11 views
22 Dec 2025
Reverse a linked list using recursion and explain the recursive flow....
12 views
22 Dec 2025
Find the middle node of a linked list using slow and fast pointers....
15 views
22 Dec 2025
Detect whether a linked list contains a loop using Floyd’s cycle detection algorithm....
14 views
22 Dec 2025
Remove a loop from a linked list once it is detected....
14 views
22 Dec 2025
Merge two sorted linked lists into one sorted list....
12 views
22 Dec 2025
Find the intersection point of two linked lists....
14 views
22 Dec 2025
Check whether a linked list is a palindrome....
12 views
22 Dec 2025
Rotate a linked list by k positions....
17 views
22 Dec 2025
Flatten a multilevel linked list into a single linked list....
11 views
22 Dec 2025
Explain what a heap data structure is and how it maintains the heap property....
17 views
22 Dec 2025
Explain the difference between Min Heap and Max Heap with use cases....
12 views
22 Dec 2025
Build a heap from an unsorted array and explain the time complexity....
15 views
22 Dec 2025
Sort an array using heap sort algorithm and explain its working....
13 views
22 Dec 2025
Implement a priority queue using heap and explain its operations....
13 views
22 Dec 2025
Find the kth largest element in an array using a heap....
14 views
22 Dec 2025
Find the kth smallest element in an array using a heap....
10 views
22 Dec 2025
Merge k sorted arrays into one sorted array using heap....
14 views
22 Dec 2025
Find the top k most frequent elements using heap....
15 views
22 Dec 2025
Find the median of a data stream using two heaps....
11 views
22 Dec 2025
Sort a nearly sorted array where each element is at most k away from its target position....
12 views
22 Dec 2025
Connect ropes with minimum cost using a min heap....
14 views
22 Dec 2025
Find k closest points to origin using heap....
14 views
22 Dec 2025
Reorganize string so that no two adjacent characters are same using heap....
14 views
22 Dec 2025
Find maximum in every sliding window of size k using heap....
16 views
22 Dec 2025
Find the smallest range that includes at least one number from each of the k lists using heap....
13 views
22 Dec 2025
Explain hashing and why hash tables are used for efficient data storage and retrieval....
12 views
22 Dec 2025
Design a basic hash table and explain how keys are mapped to indices....
14 views
22 Dec 2025
Explain different collision handling techniques such as chaining and open addressing....
16 views
22 Dec 2025
Explain separate chaining technique with an example....
13 views
22 Dec 2025
Explain linear probing for collision resolution in hashing....
13 views
22 Dec 2025
Describe quadratic probing and how it reduces clustering compared to linear probing....
13 views
22 Dec 2025
Explain double hashing and why it is considered better than other probing methods....
16 views
22 Dec 2025
Define load factor in hashing and explain its impact on performance....
14 views
22 Dec 2025
Explain rehashing and when it is required....
14 views
22 Dec 2025
Find the frequency of each element in an array using hashing....
16 views
22 Dec 2025
Check whether an array contains duplicate elements using hashing....
17 views
22 Dec 2025
Find the first non-repeating element in an array using hashing....
13 views
22 Dec 2025
Find two numbers in an array that add up to a target sum using hashing....
14 views
22 Dec 2025
Check whether a subarray with zero sum exists using hashing....
17 views
22 Dec 2025
Find the longest subarray with a given sum using hashing....
16 views
22 Dec 2025
Find the intersection of two arrays using hashing....
17 views
22 Dec 2025
Find the union of two arrays using hashing....
14 views
22 Dec 2025
Find the length of the longest consecutive elements sequence using hashing....
17 views
22 Dec 2025
Group strings that are anagrams using hashing....
14 views
22 Dec 2025
Check whether two strings are isomorphic using hashing....
14 views
22 Dec 2025
Given start and finish times of activities select the maximum number of activities that can be performed by a single person using a greedy strategy....
16 views
22 Dec 2025
Given weights and values of items determine the maximum value that can be obtained by taking fractions of items using greedy approach....
13 views
22 Dec 2025
Given coin denominations find the minimum number of coins required to make a given amount using greedy method....
15 views
22 Dec 2025
Given jobs with deadlines and profits schedule jobs to maximize total profit using greedy strategy....
14 views
22 Dec 2025
Construct a Huffman tree to generate optimal prefix codes for characters based on their frequencies....
19 views
22 Dec 2025
Given arrival and departure times of trains find the minimum number of platforms required so that no train waits....
13 views
22 Dec 2025
Given gas stations in a circular route determine if you can complete the circuit starting from a station using greedy logic....
14 views
22 Dec 2025
Distribute candies to children based on ratings such that conditions are satisfied using greedy approach....
15 views
22 Dec 2025
Select the maximum number of non-overlapping intervals using greedy technique....
15 views
22 Dec 2025
Given ropes of different lengths connect them with minimum cost using greedy strategy....
14 views
22 Dec 2025
Assign cookies to children to maximize contentment using greedy method....
13 views
22 Dec 2025
Find pairs with minimum absolute difference using sorting and greedy approach....
14 views
22 Dec 2025
Determine minimum number of boats required to rescue people based on weight limit using greedy approach....
13 views
22 Dec 2025
Rearrange characters in a string so that no two adjacent characters are the same using greedy strategy....
15 views
22 Dec 2025
Check if a string with wildcard characters can be valid parentheses using greedy technique....
14 views
22 Dec 2025
Find the maximum length chain of pairs using greedy approach similar to activity selection....
15 views
22 Dec 2025
Find the minimum number of arrows to burst balloons represented as intervals using greedy approach....
13 views
22 Dec 2025
Partition a string into as many parts as possible so that each letter appears in at most one part using greedy logic....
14 views
22 Dec 2025
Maximize profit by making multiple stock buy and sell transactions using greedy approach....
12 views
22 Dec 2025
Arrange numbers to form the largest possible number using greedy comparison....
17 views
22 Dec 2025
Explain basic graph terminology including vertices, edges, degree, path, cycle, and connected components with simple examples....
14 views
22 Dec 2025
Describe different types of graphs such as directed, undirected, weighted, unweighted, cyclic, and acyclic graphs....
15 views
22 Dec 2025
Represent a graph using an adjacency list and explain why it is memory efficient for sparse graphs....
15 views
22 Dec 2025
Represent a graph using an adjacency matrix and discuss its advantages and disadvantages....
13 views
22 Dec 2025
Traverse a graph using BFS and explain how the queue data structure is used....
15 views
22 Dec 2025
Traverse a graph using DFS and explain the recursive approach....
21 views
22 Dec 2025
Detect whether an undirected graph contains a cycle using DFS or BFS....
16 views
22 Dec 2025
Detect cycles in a directed graph using DFS and recursion stack....
15 views
22 Dec 2025
Find the number of connected components in an undirected graph....
13 views
22 Dec 2025
Perform topological sorting on a directed acyclic graph and explain its applications....
15 views
22 Dec 2025
Find the shortest path between two vertices in an unweighted graph using BFS....
13 views
22 Dec 2025
Compute shortest paths from a source vertex in a graph with non-negative weights....
14 views
22 Dec 2025
Find shortest paths and detect negative weight cycles using Bellman-Ford algorithm....
13 views
22 Dec 2025
Find shortest paths between all pairs of vertices using dynamic programming....
16 views
22 Dec 2025
Construct a minimum spanning tree using Prim’s algorithm....
14 views
22 Dec 2025
Construct a minimum spanning tree using Kruskal’s algorithm....
13 views
22 Dec 2025
Explain Union-Find (Disjoint Set Union) and its use in graph problems....
13 views
22 Dec 2025
Check whether a graph is bipartite using BFS or DFS coloring....
12 views
22 Dec 2025
Find strongly connected components using Kosaraju’s algorithm....
16 views
22 Dec 2025
Color a graph such that no two adjacent vertices share the same color....
15 views
22 Dec 2025
Explain how to represent a graph using adjacency list and adjacency matrix and compare their use cases....
15 views
22 Dec 2025
Traverse a graph using Breadth First Search and explain how a queue is used in the process....
15 views
22 Dec 2025
Traverse a graph using Depth First Search and explain the role of recursion or stack....
19 views
22 Dec 2025
Determine whether an undirected graph contains a cycle using DFS or BFS....
13 views
22 Dec 2025
Detect a cycle in a directed graph using DFS and recursion stack....
21 views
22 Dec 2025
Find the number of connected components in an undirected graph....
16 views
22 Dec 2025
Perform topological sorting of a directed acyclic graph using DFS or Kahn’s algorithm....
14 views
22 Dec 2025
Find the shortest path between two vertices in an unweighted graph using BFS....
14 views
22 Dec 2025
Find the shortest path from a source vertex to all other vertices in a weighted graph with non-negative edges....
13 views
22 Dec 2025
Compute shortest paths in a graph that may contain negative edge weights and detect negative cycles....
18 views
22 Dec 2025
Find shortest paths between all pairs of vertices using dynamic programming....
16 views
22 Dec 2025
Construct a minimum spanning tree of a graph using Kruskal’s algorithm....
12 views
22 Dec 2025
Construct a minimum spanning tree of a graph using Prim’s algorithm....
12 views
22 Dec 2025
Use Disjoint Set Union (Union-Find) to solve graph connectivity problems....
16 views
22 Dec 2025
Check whether a given graph is bipartite using BFS or DFS coloring....
15 views
22 Dec 2025
Find shortest paths in a Directed Acyclic Graph using topological ordering....
16 views
22 Dec 2025
Find strongly connected components in a directed graph using Kosaraju’s algorithm....
14 views
22 Dec 2025
Find articulation points in a graph whose removal increases number of connected components....
15 views
22 Dec 2025
Find all bridges in an undirected graph using DFS....
16 views
22 Dec 2025
Color the vertices of a graph such that no two adjacent vertices share the same color....
16 views
22 Dec 2025
Compute the nth Fibonacci number using dynamic programming and explain how memoization avoids repeated calculations....
17 views
22 Dec 2025
Given n stairs find the number of distinct ways to climb to the top when you can climb 1 or 2 steps at a time using DP....
15 views
22 Dec 2025
Given weights and values determine the maximum value that can be obtained in a knapsack of fixed capacity using DP....
19 views
22 Dec 2025
Determine whether there exists a subset of a given set with a sum equal to a given value using dynamic programming....
18 views
22 Dec 2025
Find the length of the longest common subsequence between two strings using DP table construction....
18 views
22 Dec 2025
Find the length of the longest increasing subsequence in an array using dynamic programming....
16 views
22 Dec 2025
Given coin denominations find the minimum number of coins required to make a given amount using DP....
15 views
22 Dec 2025
Find the total number of ways to make a given amount using infinite supply of coins with DP....
16 views
22 Dec 2025
Compute the minimum number of operations required to convert one string into another using DP....
18 views
22 Dec 2025
Determine the minimum number of scalar multiplications needed to multiply a chain of matrices using DP....
23 views
22 Dec 2025
Given a rod of length n determine the maximum profit by cutting the rod using DP....
19 views
22 Dec 2025
Find the maximum amount of money that can be robbed without robbing adjacent houses using DP....
24 views
22 Dec 2025
Find the maximum sum of a contiguous subarray using dynamic programming approach....
13 views
22 Dec 2025
Determine whether an array can be partitioned into two subsets with equal sum using DP....
25 views
22 Dec 2025
Find the minimum number of cuts needed to partition a string into palindromic substrings using DP....
23 views
22 Dec 2025
Find the number of unique paths from top-left to bottom-right of a grid using DP....
19 views
22 Dec 2025
Find the number of unique paths in a grid containing obstacles using dynamic programming....
16 views
22 Dec 2025
Given a numeric string count the number of ways it can be decoded into letters using DP....
17 views
22 Dec 2025
Find the minimum number of attempts needed to find the critical floor using DP....
18 views
22 Dec 2025
Find the minimum path sum from top-left to bottom-right in a grid using DP....
14 views
22 Dec 2025
Remove duplicate characters from a string while preserving order....
13 views
22 Dec 2025
Find the longest common prefix among an array of strings....
12 views
22 Dec 2025
Find the longest palindromic substring within a given string....
16 views
22 Dec 2025
Check if one string is a rotation of another string....
15 views
22 Dec 2025
Count the number of words in a sentence considering multiple spaces....
14 views
22 Dec 2025
Reverse the order of words in a sentence without reversing individual words....
16 views
22 Dec 2025
Check whether one string is a subsequence of another string....
14 views
22 Dec 2025
Generate and print all possible substrings of a given string....
11 views
22 Dec 2025
Replace all occurrences of a character with another character in a string....
17 views
22 Dec 2025
Determine whether two strings are isomorphic with proper character mapping....
15 views
22 Dec 2025
Find the length of the longest substring containing the same character after replacements....
15 views
22 Dec 2025
Check whether a string containing parentheses is valid....
15 views
22 Dec 2025
Compress a string by counting consecutive repeated characters....
16 views
22 Dec 2025
Implement naive pattern matching to find occurrences of a pattern in a text....
13 views
22 Dec 2025
Reverse a given string without using any built-in reverse function and explain the logic clearly....
14 views
22 Dec 2025
Check whether a given string is a palindrome by comparing characters from both ends....
16 views
22 Dec 2025
Count the number of vowels and consonants present in a string....
16 views
22 Dec 2025
Identify duplicate characters in a string using an efficient approach....
15 views
22 Dec 2025
Check whether two strings are anagrams of each other and explain the reasoning....
12 views
22 Dec 2025
Find the first non-repeating character in a string....
13 views
22 Dec 2025
Given an array of integers, find both the maximum and minimum elements using an efficient approach and explain why it reduces comparisons....
17 views
22 Dec 2025
Reverse the elements of an array without using extra space and explain how swapping works step by step....
17 views
22 Dec 2025
Rotate an array to the right by K positions and describe different possible approaches....
13 views
22 Dec 2025
Find the second largest element in an array without sorting the array....
14 views
22 Dec 2025
Check whether a given array is sorted in ascending order and explain the logic used....
10 views
22 Dec 2025
Move all zero elements to the end of the array while maintaining the order of non-zero elements....
14 views
22 Dec 2025
Identify all duplicate elements present in an array using efficient techniques....
19 views
22 Dec 2025
Remove duplicate elements from a sorted array in-place and return the new length....
12 views
22 Dec 2025
Find the missing number in an array containing numbers from 1 to N....
15 views
22 Dec 2025
Find the maximum sum of a contiguous subarray and explain Kadane’s Algorithm....
16 views
22 Dec 2025
Count the frequency of each element in an array and store the result efficiently....
13 views
22 Dec 2025
Merge two sorted arrays into a single sorted array without using extra space if possible....
14 views
22 Dec 2025
Find the element that appears more than n/2 times in an array using optimized approach....
15 views
22 Dec 2025
Rearrange array elements in max-min alternate order....
11 views
22 Dec 2025
Check whether there exists a subarray with a given sum and explain the sliding window technique....
13 views
22 Dec 2025
Find the intersection of two arrays and return common elements....
16 views
22 Dec 2025
Find the union of two arrays and remove duplicates....
16 views
22 Dec 2025
Given stock prices, find the maximum profit by buying and selling once....
14 views
22 Dec 2025
Calculate how much rain water can be trapped between bars of different heights....
18 views
22 Dec 2025
Distribute chocolates such that the difference between max and min is minimum....
13 views
22 Dec 2025
Search for a target element in a sorted array by repeatedly dividing the search space into two halves until the element is found or the search space becomes empty....
17 views
22 Dec 2025
Sort an array by dividing it into smaller subarrays sorting each subarray and then merging them back into a sorted array....
14 views
22 Dec 2025
Sort an array by selecting a pivot element partitioning the array around the pivot and recursively sorting the subarrays....
16 views
22 Dec 2025
Find the maximum and minimum elements in an array using the minimum number of comparisons by dividing the array into smaller parts....
16 views
22 Dec 2025
Multiply two matrices efficiently using Strassen’s divide and conquer algorithm to reduce time complexity....
19 views
22 Dec 2025
Given points on a 2D plane find the closest pair of points using divide and conquer approach....
12 views
22 Dec 2025
Multiply two large integers efficiently using the Karatsuba divide and conquer technique....
15 views
22 Dec 2025
Find the median of two sorted arrays in logarithmic time using divide and conquer....
15 views
22 Dec 2025
Tile a 2^n x 2^n board with one missing square using L-shaped trominoes and divide and conquer....
14 views
22 Dec 2025
Find the element that appears more than n/2 times in an array using divide and conquer....
15 views
22 Dec 2025
Generate the power set of a given set by dividing the set and combining results....
15 views
22 Dec 2025
Find the kth smallest element in an array using a divide and conquer based selection algorithm....
16 views
22 Dec 2025
Compute the square root of a number using binary search divide and conquer approach....
13 views
22 Dec 2025
Explain how matrix chain multiplication problem can be solved using divide and conquer and optimization ideas....
15 views
22 Dec 2025
Given buildings in a city find the skyline formed using divide and conquer technique....
50 views
22 Dec 2025
Determine whether a given integer is even or odd using bitwise operators instead of arithmetic operators....
25 views
22 Dec 2025
Given an array where every element appears twice except one find that unique element using XOR....
21 views
22 Dec 2025
Count the number of set bits (1s) in the binary representation of a number....
18 views
22 Dec 2025
Check whether a given number is a power of two using bitwise operations....
19 views
22 Dec 2025
Swap two numbers without using a temporary variable using XOR operation....
22 views
22 Dec 2025
Find the position of the rightmost set bit in a number....
21 views
22 Dec 2025
Turn off the rightmost set bit of a given number....
19 views
22 Dec 2025
Set the ith bit of a given number using bitwise operators....
21 views
22 Dec 2025
Clear the ith bit of a given number....
23 views
22 Dec 2025
Toggle the ith bit of a number using XOR....
21 views
22 Dec 2025
Check whether the ith bit of a number is set or not....
16 views
22 Dec 2025
Multiply a number by two using left shift operation....
17 views
22 Dec 2025
Divide a number by two using right shift operation....
23 views
22 Dec 2025
Find the missing number in an array containing numbers from 1 to N using XOR....
16 views
22 Dec 2025
Find the element that appears once when others appear three times....
15 views
22 Dec 2025
Add two integers without using the + operator....
17 views
22 Dec 2025
Reverse the bits of a given 32-bit unsigned integer....
15 views
22 Dec 2025
Check whether two integers have opposite signs using bit manipulation....
18 views
22 Dec 2025
Compute bitwise AND of all numbers in a given range [L, R]....
20 views
22 Dec 2025
Generate the sequence of Gray codes for n bits using bit manipulation....
20 views
22 Dec 2025
Given an N x N chessboard place N queens such that no two queens attack each other using backtracking....
19 views
22 Dec 2025
Generate all possible permutations of a string using backtracking and recursion....
20 views
22 Dec 2025
Generate all subsets of a given array using backtracking....
15 views
22 Dec 2025
Find all combinations that sum to a target where numbers can be reused....
19 views
22 Dec 2025
Find unique combinations that sum to target where each number is used once....
16 views
22 Dec 2025
Generate all valid combinations of balanced parentheses....
17 views
22 Dec 2025
Check if a word exists in a grid using backtracking....
19 views
22 Dec 2025
Solve a partially filled Sudoku board using backtracking....
21 views
22 Dec 2025
Find all paths from source to destination in a maze using backtracking....
18 views
22 Dec 2025
Visit all squares of a chessboard using a knight exactly once....
20 views
22 Dec 2025
Partition a string into all palindromic substrings....
20 views
22 Dec 2025
Generate all valid IP addresses from a digit string....
18 views
22 Dec 2025
Generate all letter combinations from phone digits....
21 views
22 Dec 2025
Color a graph using M colors without adjacent conflicts....
17 views
22 Dec 2025
Determine if a Hamiltonian path exists in a graph....
15 views
22 Dec 2025
Check if array can be partitioned into K equal sum subsets....
22 views
22 Dec 2025
Generate binary strings of length N without consecutive ones....
17 views
22 Dec 2025
Remove minimum invalid parentheses to make string valid....
16 views
22 Dec 2025
Find all paths in grid with obstacles using backtracking....
15 views
22 Dec 2025
Break a string into dictionary words using backtracking....
21 views
22 Dec 2025
Design an LRU (Least Recently Used) Cache that supports get(key) and put(key, value) operations in constant time O(1). The cache should automatically remove the least recently accessed item when the c...
28 views
22 Dec 2025
Design a stack data structure that supports standard stack operations such as push, pop, and top, along with an additional operation getMin() that returns the minimum element present in the stack at a...
19 views
22 Dec 2025
Implement a Trie (Prefix Tree) data structure that supports insertion of words and searching for complete words as well as prefixes. Explain how the Trie improves search efficiency compared to a norma...
23 views
22 Dec 2025
Implement the Disjoint Set Union (Union-Find) data structure with path compression and union by rank. Explain how these optimizations reduce the time complexity of find and union operations in large d...
14 views
22 Dec 2025
Design and implement a Segment Tree to efficiently answer range sum queries on an array. The structure should also support point updates. Explain how segment trees divide the problem space and why the...
18 views
22 Dec 2025
Implement a Fenwick Tree (Binary Indexed Tree) to handle prefix sum queries and updates efficiently. Compare its performance and memory usage with a Segment Tree....
20 views
22 Dec 2025
Given an array and a window size k, design a data structure that efficiently finds the maximum element in every sliding window. Explain how a deque helps achieve linear time complexity....
15 views
22 Dec 2025
Implement a Priority Queue using a binary heap. Explain how insertion and deletion operations maintain the heap property and why heaps are suitable for priority-based processing....
18 views
22 Dec 2025
Design a data structure that continuously receives numbers from a data stream and returns the median at any time. Explain how two heaps can be used to balance the elements and compute the median effic...
22 views
22 Dec 2025
Explain the difference between LRU (Least Recently Used) and LFU (Least Frequently Used) caching strategies. Discuss scenarios where one strategy is preferred over the other and the data structures re...
22 views
22 Dec 2025
You are given an array of integers and need to handle two types of queries efficiently:
Range Update: Add a value to all elements in a given range [l, r]
Range Query: Find the minimum value in a...