Sudhir sharma has Published 1149 Articles

Print all ways to break a string in bracket form in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 10:10:23

169 Views

In this problem, we are given a string and we have to break it into substrings and print them enclosing brackets.Let’s take a few examples to understand the problem better, Input : wxyz Output :    (w) (x) (y) (z)    (w) (x) (yz)    (w) (xy) (z)    (w) ... Read More

Print all words matching a pattern in CamelCase Notation Dictionary in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 10:07:39

331 Views

In this problem, we are given an array of string in camelcase and a pattern. We have to print all those string of the array that match the given pattern.The array of string is an array in which elements are of the string data type.camelCase is a common method for ... Read More

Print alternate nodes of a linked list using recursion in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 10:03:30

219 Views

A linked list is a linear data structure that stores the element in non-contiguous memory locations. Every element contains a pointer to the next element of the linked list.Example −In this problem, we are given a linked list and we need to print the elements of this linked list but ... Read More

Print an N x M matrix such that each row and column has all the vowels in it in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 10:00:21

286 Views

In this problem, we have to create a 2D matrix of size n X m. And in this matrix, we have to place only vowels in such a way that each row and column has all vowels in it.All vowels mean all a, e, i, o, u are present in ... Read More

Print ancestors of a given binary tree node without recursion in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:57:21

186 Views

In this problem, we are given a binary tree and we have to print its ancestor of a node in a binary tree.Binary Tree is a special tree whose every node has at max two child nodes. So, every node is either a leaf node or has one or two ... Read More

Print Ancestors of a given node in Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:52:43

2K+ Views

In this problem, we are given a binary tree and we have to print its ancestor of a node in a binary tree.Binary Tree is a special tree whose every node has at max two child nodes. So, every node is either a leaf node or has one or two ... Read More

Print array elements in alternatively increasing and decreasing order in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:48:44

461 Views

In this problem, we are given an array of number and we have to print the elements of the array in alternatively increasing and decreasing order while printing. The alternative order will be in such a way that 1st two elements are in increasing order and then the next three ... Read More

Print array elements that are divisible by at-least one other in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:45:45

356 Views

In this problem, we are given an array of integers and we have to print only those numbers that are divisible by at least one other element of the array.Let’s take an example to understand the concept better, Input : 3 12 16 21 Output : 12 21Explanation − ... Read More

Print array of strings in sorted order without copying one string into another in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:42:54

522 Views

In the problem to print an array of strings in sorted order without copying one string into another, we need to sort the array of string. Here the programmer cannot copy a string into another string while sorting.Let’s take an example to understand the concept better :Example −Input : {“Delhi”, “Hyderabad”, ... Read More

Print Binary Tree in 2-Dimensions in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:39:06

1K+ Views

In this problem, we are given a binary tree and we have to print it two dimensional plane.Binary Tree is a special tree whose every node has at max two child nodes. So, every node is either a leaf node or has one or two child nodes.Example, Let’s take an ... Read More

Advertisements