Dev Prakash Sharma has Published 556 Articles

Validate IPv6 address using ReGex patterns in C++

Dev Prakash Sharma

Dev Prakash Sharma

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

1K+ 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

2K+ 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

Update the bit in the given position or Index of a number using C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:56:21

2K+ Views

In the given problem, we have to update the bit of the given index of a number. To update the number, we can use Bit Manipulation operation on a given number. For example, Input-1 −N= 25 bit= 1 position= 2Output −29Explanation − Since the given input 25 can be written ... Read More

static_assert in C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:55:01

265 Views

static_assert is a function which is useful for programmers to print the error in the screen after compiling the program without messing up with the output too much.Earlier in C++11 and C++14, static_assert had different functionality which means we have to write our own message while defining the static_assert. However, ... Read More

Square of a sorted array in C++

Dev Prakash Sharma

Dev Prakash Sharma

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

1K+ Views

In the given array of sorted integers, the task is to print the squares of every array element and print the array in sorted order. For example, Input-1 −arr[ ] = { -3, -1, 0, 1, 4, 6 };Output −{0, 1, 1, 9, 16, 36}Explanation − The squares of each ... Read More

Sort an arrays of 0’s, 1’s and 2’s using Java

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:53:48

253 Views

Given an array of 0, 1 and 2 sort the element in an order such that all the zeros come first before 1 and all the 2’s in the end. We have to sort all the elements of the array in-place.We can solve this problem using DNF (Dutch National Flag) ... Read More

Sort an arrays of 0’s, 1’s and 2’s using C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:53:04

705 Views

Given an array of 0, 1, and 2, sort the elements in an order such that all the zeros come first before 1 and all the 2’s in the end. We have to sort all the elements of the array in-place.We can solve this problem using DNF (Dutch National Flag) ... Read More

Significance of Lambda Function in C/C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:51:35

4K+ Views

Lambda Function − Lambda are functions is an inline function that doesn’t require any implementation outside the scope of the main program.Lambda Functions can also be used as a value by the variable to store. Lambda can be referred to as an object that can be called by the function ... Read More

Search an element in the given singly Linked List using C++

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Feb-2021 12:50:20

397 Views

Given a singly linked list, the task is to search a particular element in the linked list. If the element is found, then print “present” otherwise “Not present”. For example, Input-1 −1→ 2→ 3→ 4→ 5→ 6Searching for ‘7’Output −Not PresentExplanation − In the given singly linked list the element ... Read More

Advertisements