DAY-1
- practice operators, Conditional satatements.
DAY-2
- Write a Java program to find the numbers greater than the average of the numbers of a given array.
- Write a Java program that takes a number as input and prints its multiplication table upto 10.
- Write a Java program to sum values of an array.
- Write a Java program to find the maximum and minimum value of an array.
- Write a Java program to separate Os on left side and 1s on right side of an array of Os and 1s inrandom order.
- Write a Java method to find the smallest number among three numbers.
- Write a Java method to print Fibonacci series of n terms where n is argument passed by user.
- Write a program to find the factorial value of any number entered through the keyboard.
DAY-3
- Learn Time and Space complexity.
- practice some questions
DAY-4 (Array)
-
Search in an Array.
-
Delete an element from an Array.
-
Find the largest element in an Array.
-
Find the second largest element in an Array.
-
Remove the duplicates from a sorted Array.
-
Find the smallest element in the given Array.
-
Find the Third Largest Element in an Array.
-
Check if the Array is Sorted.
-
Reverse the given Array.
-
Write a program to replace every element with the greatest element on its right side.
Expected Output: The given array is :7589685746 After replace the modified array is: 9998877660
DAY-5
-
Leaders in Array.
-
Maximum sum subarray.
-
Container with most water.
-
Trapping rain water problem.
-
Print frequency of all the elements in a sorted Array.
-
In an Array of all 0s and 1s, find the largest lenght of all consecutive 1s.
Input: The given array is : 1,1,1,0,0,1,1,1,1,0,1 Output: 4
-
Move all 0s to the end of the given Array.
Input: 8,0,3,0,0,5 Output: 8,1,3,5,0,0,0
-
Trapping rain water problem in O(1) space complexity.
-
Minimum Sum Subarray problem.
-
Print the elements in the maximum sum subarray.
-
Stocks buy & sell problem.
DAY-6
- Find if there is a subarray with 0 sum.
- Transpose of a Matrix.
- Rotate a Matrix 90 degree clockwise.
- Search element in Row-wise and Column-wise Sorted Matrix.
- Split array in three equal sum subarray.
- Find the largest subarray with equal numbers of 0s and 1s.
- Majority Elements Problem- Find the element that repeats more than n/2 times.
- Left Rotate an Array by 1 step.
- Left Rotate an Array by k steps.
DAY-7
- Given an array arr[i], find the maximum j-i such that arr[j]>arr[i].
- Find two numbers in a sorted Array with the given Sum.
- Find three Numbers in an unsorted Array with the Given sum.
DAY-8 (Recursion & Backtracking)
- Sum of n Natural Numbers using Resursion.
- Power of a Number using Recursion.
- Find the Number of paths in an nxm Matrix.
- Check if an array is a Palindrome using Resursion.
- Factorial of a number using Resursion.
- Find the sum of square of N Natural numbers using Resursion.
- Find the Greatest common divisor(GCD).
DAY-9
- Find the sum of digits in a number using Recursion.
- Generate all subsets/subsequence of a String.
- Tower of Hanoi Problem.
- Print all peermutations of a given String.
- Rope Cutting Problem- Maximise the number of rods after cutting a rod with three given sizes.
- Josephus Problem.
DAY-10
- Rat in a Maze Problem.
- N Queens Problem.
- Sudoku Solver Problem.
- Subset sum Problem.
DAY-11 (Mathematics)
- Palindrome numbers.
- GCD or HCF of two numbers.
- LCM of two numbers.
- Trailing Zeros in factorial.
- Unique Paths in a grid.
- Calculate square roots of an equation.
DAY-12
- Check prime or not.
- Efficient &
- More Efficient solution for prime.
- Print all divisors of N.
- Sieve of Eratosthenes.
- Fast power, Calculate pow(a,b).
- Calculate a^b mod n for large values of a & b.
- Prime factors of a given number.
DAY-13 (Bits Manipulation)
- Find the "i"th bit.
- Toggle the 'i'th bit.
- Check if a number is power of two.
- Count the number of set bits in a number.
- Check if a number is even or odd.
- Swap two numbers without using third variable.
- Set the i th bit to 1.
- Unset the i th bit/ change i th bit to 0.
- Given a number N, the task to find the XOR of all numbers from 1 to N.
- How many bits are required to change to convert to one number to another.
DAY-14
- Find the only non-repeating element in an array where every other element repeats twice.
- Find the two non-repeating element in an array where every other element repeats twice.
- Swap two bits in a given integer.
- Reverse the bits of an 32 bit unsigned integer.
- Find the only non-repeating element in an array where every other element repeats thrice.
DAY-15 (Strings)
- Check if two Strings are Anagram of each other.
- Reverse the words in a given String.
- Check if String is a subsequence of another string.
- Find the leftmost character that repeats in a String.
- Find the length of the last word in a given strring.
DAY-16
- Patterrn matching.
- Rabin Karp Algorithm.
- Check if Strings are rotations.
- Find the longest substring with distinct characters.
DAY-17 (Sorting Algorithms)
- Bubble sort.
- Insertion sort.
- Selection sort.
- Intersection of two sorted arrays.
- Sort an array with three types of elements.
- Union of two sorted arrays.
- Find the minimun between two elements in an array.
- Sort an array of two types of elements.
DAY-18
- Quick sort.
- Merge sort.
- Given a set of Strings, find the longest common prefix using Divide and Conquer.
- Strassen's Matrix Multiplication.
- Find closest pair of points using Divide and Conquer algorithm.
DAY-19 (Binary Search)
- Binary search.
- Index of the first occurrence of an element in a sorted arrar.
- Index of the last occurrence of an element in a sorted arrar.
- Count the occurance of elements in a sorted array
- Search in a sorted rotated array.
- Find the first position of 1 in a sorted array containing only 0s and 1s.
- Find the upper bound of an element in a sorted array.
- Given a sorted array with no duplicates A and a target value B, return the index if the target is found. If not, rerturn the index where it would be if it were inserrted in order.
DAY-20
- Search an element in an infinite sorted aray.
- Find the square root of an integer.
- Find the median of two sorted arrays.
DAY-21 [IC]
- Tree cutting problem.
- Books allocation problem.
- Aggressive cows problem.
- Given a matrix of integers A of size NxM in which each row is sorted. Find and return the overall median of the matrix A.
- Painter's partition problem.
DAY-22 (Hashing)
- Count distinct elements.
- Frerquency of Elements in an array.
- Pair with given sum in unsorted array.
- Zero sum subaray.
- Subarray with given sum.
- Intersection of Two Arrays.
- Union of two arrays.
- Find largest subarray with zero sum.
- Count distinct elements in every window of size k.
DAY-23
- Largest subaarray with zero sum.
- Longest consecutive subsequence.
- Find any quadruple whose sum is equal to the given sum.
- Longest Substring without repeat.
DAY-24 (LinkedList)
- Traverse, insert, delete in a LinkedList.
- Find the middle element in a LinkedList.
- Delete an element whose pointer is given in a LinkedList.
- Find the Kth element from last in a LinkedList.
- Remove duplicates from a sorted LinkedList.
- Sort a LinkedList using Bubble sort.
- Find the intersection of two LinkedList.
- Check if a Singly LinkedList ia a Palindrome.
DAY-25
- Reverse a LinkedList - iteratively.
- Reverse a LinkedList - recursively.
- Reverse a LinkedList in a group of k.
- Detect a cycle in a LinkedList.
- Palindrome LinkedList.
- Rotate a LinkedList by k nodes.
- Add two numbers (each digit is present inside a node of linkedList)
- Merge a Linked List into another Linked List inside a node of Linked List.
DAY-26
- Merge two sorted Linked Lists.
- Palindrome Linked List.
- Doubly Linked List implementation.
- Implement LRU cache.
- Clone a Linked List with next and random pointer.
- Given a Linked List A, reverse the order of all nodes at even positions.[IC]
DAY-27 (Stack)
- Implementation of Stack using Array.
- Implementation of Stack using LinkedList.
- Parenthesis matching problem.
- Previous / Next greater element.
- Previous / Next less element.
- Reverse words in a given sentence.
- Reverse a stack using recursion.
- Reverse a stack without using extra space.[IC]
- Delete the mid element from a given stack.
DAY-28
- Infix to postfix conversion.
- Evaluate postfix expression.
- Infix to prefix conversion.
- Postfix expression to a prefix expression.
DAY-29
- Implement two stacks using one array.
- Find maximum area in a histogram.
- Find maximum area submatrix in a matrix.
- Implement minStack using O(n) extra space.
- implement k stack using Array. [IC]
- Implement minStack using O(1) space.
- Simply Directory Path.
DAY-30 (Queue)
- Implement queue using Linked List.
- Implement queue using Array.
- Implement queue using circular Array.
- Implement queue using Two Stacks.
- Implement stack using Two Queues.
- Implement stack using One Queue.
- Reverse a Queue.
DAY-31
- Reverse the first k elements of a Queue.
- Circular tour problem.
- Sliding window maximum problem.
- Flatten a multi-level linked List.
DAY-32 (Binary Tree)
- Binary tree.
- Inorder, preorder, postorder traversal in binary tree.
- Height of a binary tree.
- Print all the nodes present at a distance k from Root.
- Size of a binary tree.
- Maximum/ minimum in a binary tree.
- Inorder, preorder, postorder traversal without using recursion.
DAY-33
- Binary tree level order traversal [LC- 102].
- Binary tree right side view [LC- 199].
- Top view of a binary tree.
- Print the zig-zag order traversal of a binary tree.
- Print the left view of a binary tree.
- Print the bottom view of a binary tree.
- Modified vertical order traversal.[IC]
- Cousins in a binary tree.
- Populate the next pointer in each node.[IC]
- Vertical Order Traversal of a Binary Tree.
DAY-34
- Inorder/ preorder/ postorder traversal without recursion.
- Diameter of a binary tree.
- Postorder of a binary tree without using two stacks.
- Morris traversal.
DAY-35
- Print all the ancestors of a given node in a binary tree.
- Lowest common ancestor of a binary tree.
- Convert a binary tree to a doubly linkedlist.
- Burn a binary tree starting from a leaf node.
DAY-36 (Binary Search Tree)
- Search in BST.
- Insert an element in a BST.
- Delete an element in a BST.
- Check if a binary tree is BST.
- Convert a sorted array to balanced BST.
- Check if a given array can represent preorder traversal of BST.
- Second largest element in BST.
- Print BST keys in given range.
DAY-37
- Check if a binary tree is BST.
- Shortest distance between two nodes in BST.
- Find a pair with given target sum in a BST.
- Find floor and ceil values in a BST.
- Construct a BST from given preorder traversal.
DAY-38 (AVL Tree)
- Insertion & Rotations.
Day-39 (Heap)
- Insertion in heaps.
- Deletion in heaps & heapify.
- Implement insertion and deletion for MaxHeap.
DAY-40 (Priority queue)
- Heap sort.
- Find the kth largest element in an array.
- Maximum sum of at most two non-overlapping intervals in a list of intervals.
- Split Array into K non-overlapping subset such that maximum among all subset sum is minimum.
- Maximize profit possible by selling M products such that profit of a product is the number of products left of that supplier.
DAY-41
- Connect n ropes with minimum cost.
- Split Array into K subset such that maximum among all subset sum is minimum.
- Find the median in a running steam of numbers.
- Merge k sorted lists.
- Check if a given array represents a binary heap.
- Magicians and chocolates.
- N max pair combinations. [IC]
DAY-42 (Disjoint sets)
- Implementation of union-find.
- Union-find with rank.
- Union-find with path compression.
DAY-43 (Graphs)
- Graphs using adjacency list & matrix.
- DFS traversal.
- BFS traversal.
DAY-44
- Number of connected components in a graph.
- Shortest Path in a graph.
- Detect a cycle in an undirected graph. [IC]
- Detect a cycle in an directed graph.
- Chech weather a given graph is bipartite or not.
- Check weather a path exists.
DAY-45
have to solve some problems on graphs. TBC