Sudhir sharma has Published 1206 Articles

Print all palindrome permutations of a string in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:34:45

300 Views

In this problem, we are given a string and we have to print all the palindromic permutations that are possible from the characters of that string.Let’s take an example to understand the problem −Input − string = ‘aabb’Output − abba baabTo solve this problem we have to take the characters ... Read More

Print all pairs with given sum in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:33:46

340 Views

In this problem, we are given an array of integers and an integer sum and we have to print all pairs of integers whose sum is equal to the sum value.Let’s take an example to understand the problem :Input − array = {1, 6, -2, 3} sum = 4Output − ... Read More

Print all paths from a given source to a destination using BFS in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:28:01

958 Views

In this problem we are given a directed graph and we have to print all paths from the source to the destination of the graph using Breadth first Search (BFS).Directed graph is a graph in with edges that are directed from vertex a to b.Let’s take an example to understand the ... Read More

Print all permutation of a string using ArrayList in Java

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:27:07

589 Views

In this problem, we are given a string of size n and we have to print all permutations of the string. But this time we have to print this permutation using ArrayList.Let’s take an example to understand the problem -Input − string = ‘XYZ’Output − XYZ, XZY, YXZ, YZX, ZXY, ... Read More

Print all permutations with repetition of characters in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:25:19

784 Views

In this problem, we are given a string of n characters and we have to print all permutations of characters of the string. Repeating of characters of the string is allowed. The printing of permutation should be done in alphabetical order (lexicographically sorted order).Let’s take an example to understand the ... Read More

Binary Tree to Binary Search Tree Conversion in C++

sudhir sharma

sudhir sharma

Updated on 13-Jul-2020 08:08:08

847 Views

A binary tree is a special type of tree in which each node of the tree can have at most two child nodes. These child nodes are known as the right child and left child.A simple binary tree is −Binary search tree (BST) is a special type of tree which ... Read More

Binary to Gray code using recursion in C program

sudhir sharma

sudhir sharma

Updated on 09-Jul-2020 11:49:04

2K+ Views

A Binary number is a number that has only two bits 0 and 1.Gray code is a special type of binary number that has a property that two successive number of the code cannot differ more than one bit. This property of gray code makes it useful more K-maps, error ... Read More

Binary representation of previous number in C++

sudhir sharma

sudhir sharma

Updated on 09-Jul-2020 11:40:57

230 Views

In this problem, we are given the binary representation of a number and we have to find the binary representation of the previous number i.e. the number that is resulted after subtracting one from the given number.Binary representation of a number is changing the base of the number to base ... Read More

Binary Search a String in C++

sudhir sharma

sudhir sharma

Updated on 09-Jul-2020 11:40:08

4K+ Views

In Binary search a string, we are given a sorted array of strings and we have to search for a string in the array of strings using binary search algorithm.ExampleInput : stringArray = {“I”, “Love”, “Programming”, “tutorials”, “point”}. Element = “programming” Output : string found at index 3 Explanation : ... Read More

Bakhshali Approximation for computing square roots in C program

sudhir sharma

sudhir sharma

Updated on 09-Jul-2020 05:52:06

514 Views

Bakhshali approximation is a method of computing the square root of a number which is not a perfect square. Now, lets brush-related terms to easily understand the concept.Square root of a number x is a number that satisfies the following condition, y2 = x.Perfect Square is a number whose square ... Read More

Advertisements