Dev Prakash Sharma has Published 548 Articles

Breadth First Search on Matrix in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 05:37:17

2K+ Views

In a given matrix, there are four objects to analyze the element position: left, right, bottom, and top.Breadth First Search is nothing but finding the shortest distance between the two elements of a given 2-D Matrix. Thus, in each cell, there are four operations we can perform which can be ... Read More

How to Segregate a given Linked List in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 05:22:40

241 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

Check if a Tree is Isomorphic or not in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 04:50:26

379 Views

In a binary tree, each node contains two children, i.e., left child and right child. Let us suppose we have two binary trees and the task is to check if one of the tree can be obtained by flipping another tree by left of it or not.A Tree is Isomorphic ... Read More

Breadth First Search on Matrix in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 04:49:36

1K+ Views

In a given matrix, there are four objects to analyze the element position: left, right, bottom and top.Breadth First Search is nothing but finding the shortest distance between the two elements of a given 2-D Matrix. Thus in each cell, there are four operations we can perform which can be ... Read More

Binary Tree Tilt in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 23-Feb-2021 04:47:44

335 Views

Let us consider that we have the root node of a binary tree; the task is to find and return the sum of tilt of every node.The tilt of a binary tree is nothing but constructing the binary tree by finding the absolute difference of child nodes in the left ... Read More

Tim Sort Algorithm in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:59:11

2K+ Views

The Timsort is a stable sorting algorithm that uses the idea of merge sort and insertion sort. It can also be called as a hybrid algorithm of insertion and merge sort. It is widely used in Java, Python, C, and C++ inbuilt sort algorithms. The idea behind this algorithm is ... Read More

What are Delannoy Numbers? Write a program in C++ to find the Delannoy number

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:58:37

218 Views

Delannoy Numbers − A Delannoy number D describes the number of paths from the southwest corner(0, 0) to northeast corner(a, b) in a rectangular grid using only allowed steps east ( →), northeast ( ↗ ) and north ( ↑ ).Thus, we can say that a recurrence relation is, D(a, ... Read More

Validate IPv6 address using ReGex patterns in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:57:54

2K+ Views

Given an IP Address, the task is to validate this IP address and check whether it is IPv6 or not with the help of ReGex(Regular Expression). If the IP Address is valid then print “IPv6 Address” otherwise print “Not”.A valid IPv4 address is an IP in the form "XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX" where ... Read More

Validate IPv4 address using ReGex patterns in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:57:29

2K+ Views

Given an IP Address, the task is to validate this IP address and check whether it is IPv4 or not with the help of ReGex(Regular Expression). If the IP Address is valid then print “IPv4 Address” otherwise print “Not”.A valid IPv4 address is an IP in the form "X1.X2.X3.X4" where ... Read More

Valid Sudoku in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:57:03

3K+ Views

Let’s suppose we’ve given a 9×9 matrix called a Sudoku. The task is to check whether the given Sudoku Pattern is valid or not.In general, a Sudoku board look like this, Rules of Sudoku −Every row contains a number in the range 1-9Every column contains numbers in the range 1-9.Each ... Read More

Advertisements