## Minimum replacements to make adjacent characters unequal in a ternary string | Set-2

Given a string of ‘0’, ‘1’ and ‘2’. The task is to find the minimum number of replacements such that the adjacent characters are not… Read More »

- How can one become good at Data structures and Algorithms easily?
- How do Dynamic arrays work?
- Find the node with maximum value in a Binary Search Tree
- Remove last node of the linked list
- Iterative Method To Print Left View of a Binary Tree
- Sort the array of strings according to alphabetical order defined by another string
- Fibonacci Heap - Deletion, Extract min and Decrease key
- Zig-Zag traversal of a Binary Tree using Recursion
- Number of array elements derivable from D after performing certain operations
- Print all nodes between two given levels in Binary Tree
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Print all odd nodes of Binary Search Tree
- Number of subarrays have bitwise OR >= K
- Reverse zigzag Traversal of a Binary Tree
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Number of sub-strings which are anagram of any sub-string of another string
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Difference between Stack and Queue Data Structures
- Sum and Product of minimum and maximum element of Binary Search Tree
- Minimum number of edges between two vertices of a graph using DFS
- Building Expression tree from Prefix Expression
- Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
- Sum of minimum elements of all possible sub-arrays of an array
- Delete all odd or even positioned nodes from Circular Linked List
- Sum of all the elements in an array divisible by a given number K
- Sum and Product of the nodes of a Circular Singly Linked List which are divisible by K
- Find maximum among all right nodes in Binary Tree
- Finding the path from one vertex to rest using BFS
- Product of all nodes in a Binary Tree
- Multidimensional Collections in Java

Given a string of ‘0’, ‘1’ and ‘2’. The task is to find the minimum number of replacements such that the adjacent characters are not… Read More »

Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative or… Read More »

Given two integers A and B, the task is to generate and print a string str such that: str must only contain the characters ‘a’… Read More »

Given a Linked List as the input. The task is to encode the given linked list using Run Length Encoding. That is, to replace a… Read More »

Given an array arr[] of N integers and an integer S. The task is to find an element K in the array such that if… Read More »

Given the value of ‘N’ and ‘I’. Here, represents the number of internal nodes present in an N-ary tree and every node of the N-ary… Read More »

There are N distinct integers arranged on a circle. The distance between any two adjacent numbers is 1. The task is to travel on this… Read More »

Given a Binary tree, print all the leaf nodes of a Binary tree at a given level L. Examples: Input: 1 / \ 2 3… Read More »

Given N strings of equal lengths. The strings contain only digits (1 to 9). The task is to count the number of strings that have… Read More »

Given two strings S and T of equal length. Both strings contain only the characters ‘0’ and ‘1’. The task is to find the minimum… Read More »

Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of… Read More »

Given a linked list. The task is to reverse the order of the elements of the Linked List using an auxiliary Stack. Examples: Input :… Read More »

Given an integer l and a tree represented as an undirected graph rooted at vertex 0. The task is to print the number of nodes… Read More »

Given an N x N matrix and two integers S and K, the task is to find whether there exists a K x K sub-matrix… Read More »

Given a singly linked list, write a function to swap elements pairwise. Input : 1->2->3->4->5->6->7 Output : 2->1->4->3->6->5->7, Input : 1->2->3->4->5->6 Output : 2->1->4->3->6->5 Recommended:… Read More »