Reverse a Linked List in groups of given size using Stack
Given a linked list, write a function to reverse every k node (where k is an input to the function)....
read more
Python Program For Sorting An Array Of 0s, 1s and 2s
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Examples:...
read more
Python3 Program for Search an element in a sorted and rotated array
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
read more
Print all possible words from phone digits
Given a keypad as shown in the diagram, and an n digit number, list all words which are possible by pressing these numbers....
read more
Java Program for Search an element in a sorted and rotated array
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
read more
Java Program For Sorting An Array Of 0s, 1s and 2s
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Examples:...
read more
Find the smallest positive number missing from an unsorted array | Set 1
Given an unsorted array arr[] with both positive and negative elements, the task is to find the smallest positive number missing from the array....
read more
Find the Maximum Depth or Height of given Binary Tree
Given a binary tree, the task is to find the height of the tree. The height of the tree is the number of vertices in the tree from the root to the deepest node....
read more
Largest Sum Contiguous Subarray (Kadane’s Algorithm)
Given an array arr[] of size N. The task is to find the sum of the contiguous subarray within a arr[] with the largest sum....
read more
Python Program For Reversing A Linked List In Groups Of Given Size- Set 2
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples:...
read more
Python Program For Flattening A Linked List
Given a linked list where every node represents a linked list and contains two pointers of its type:...
read more
C++ Program For Reversing A Linked List In Groups Of Given Size – Set 2
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples:...
read more