Dev Prakash Sharma has Published 548 Articles

Intersection of Two Linked Lists in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:28:35

1K+ Views

A Linked List is a linear data structure in which each node has two blocks such that one block contains the value or data of the node and the other block contains the address of the next field.Let us assume that we have a linked list such that each node ... Read More

Largest Merge of Two Strings in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:26:42

255 Views

Let us suppose we have two strings 'a' and 'b' and a string 'merge'. The task is to fill the string 'merge' with the characters from 'a' and 'b' in such a way that, If the string 'a' is non-empty, then remove the first character from the string 'a' and ... Read More

Make three numbers Zero in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:22:11

255 Views

Let us suppose we have three numbers. The task is to count the total number of optimal steps to make all these numbers '0'.For ExampleInput-1:a = 4 b = 4c = 6Output:7Explanation: Total number of optimal steps to make all the numbers '0' is, (4, 4, 6)Removing '1' from 1st and ... Read More

Powerful Integers in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:19:43

262 Views

Let us suppose we have three integers 'a' and 'b' and 'limit'. The task is to print the numbers in the range [a, limit]. List of these numbers is said to be powerful integers and represented as, a^i + b^j such that i >= 0 and j >= 0For ExampleInput-1:a ... Read More

Write a program in C++ to split two strings to make it a palindrome

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:14:29

295 Views

A string is said to be a palindromic string if it remains the same after reversing it.In this particular problem, we've given two strings 'a' and 'b' of the same length. If they are split with some indexes, then the task is to check whether the sum of the strings ... Read More

Symmetric Tree in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:10:18

705 Views

Let us suppose we have a binary tree and the task is to check whether it constructs a symmetry of itself or not. A Symmetric Binary tree constructs the mirror image of itself.For ExampleInput-1:           Output:TrueExplanation:Since the given binary tree constructs the mirror image of itself, the output ... Read More

Balanced Binary Tree in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:08:10

5K+ Views

In a binary tree, each node contains two children, i.e left child and right child. Let us suppose we have a binary tree and we need to check if the tree is balanced or not. A Binary tree is said to be balanced if the difference of height of left ... Read More

Copy list with random Pointer in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:03:40

756 Views

A Linked List is a linear data structure in which each node is having two blocks such that one block contains the value or data of the node and the other block contains the address of the next field.Let us assume that we have a linked list such that each ... Read More

Largest Merge of Two Strings in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 19:01:14

291 Views

Let us suppose we have two strings 'a' and 'b' and a string 'merge'. The task is to fill the string 'merge' with the characters from 'a' and 'b' in such a way that, If the string 'a' is non-empty, then remove the first character from the string 'a' and ... Read More

Make three numbers Zero in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:56:04

314 Views

Let us suppose we have three numbers. The task is to count the total number of optimal steps to make all these numbers '0'.For ExampleInput-1:a = 4 b = 4 c = 6Output:7Explanation:The total number of optimal steps to make all the numbers '0' is, (4, 4, 6)Removing '1' from ... Read More

Advertisements