Dev Prakash Sharma has Published 556 Articles

Copy list with random Pointer in Python

Dev Prakash Sharma

Dev Prakash Sharma

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

663 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

174 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

235 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

Python Program to Construct an Expression Tree of a given Expression

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:49:16

2K+ Views

Expression trees are those in which the leaf nodes have the values to be operated, and the internal nodes contain the operator on which the leaf node will be performed.Example: 4 + ((7 + 9) * 2) will have an expression tree like -Approach to solve this ProblemIn order to construct ... Read More

Find the Intersection Point of Two Linked Lists in Java

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:42:34

514 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

Find the Nth Ugly Number in Java

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:37:00

834 Views

A number whose prime factors are either 2, 3 or 5 is called an Ugly Number.  Some of the ugly numbers are: 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, etc.We have a number N and the task is to find the Nth Ugly number in the sequence ... Read More

Selection Sort in Go Lang

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:27:34

1K+ Views

Selection sort is a sorting algorithm that is used to sort the elements by repeatedly finding the minimum element and placing it at the first in the unsorted part of the array. After placing the minimum element in one end of the array, the array is then divided into two ... Read More

How to align multiple plots in a grid using GridSpec Class in Matplotlib

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:22:08

784 Views

Aligning the multiple plots in a grid can be very messy and it can create multiple issues like higher width and height or minimal width to align all the plots. In order to align all the plots in a grid, we use GridSpec class.Let us suppose that we have a ... Read More

Plotting regression and residual plot in Matplotlib

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:14:13

2K+ Views

To establish a simple relationship between the observations of a given joint distribution of a variable, we can create the plot for the regression model using Seaborn.To fit the dataset using the regression model, we have to first import the necessary libraries in Python.We will create plots for each regression ... Read More

Algorithm to construct an Expression Tree in Data Structure

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 18:11:51

7K+ Views

Expression treesExpression trees are those in which the leaf nodes have the values to be operated, and internal nodes contain the operator on which the leaf node will be performed.Example4 + ((7 + 9) * 2) will have an expression tree as followsAlgorithm to Construct an Expression TreeLet T be the ... Read More

Advertisements