Ajay yadav has Published 46 Articles

Reverse a String (Iterative) C++

Ajay yadav

Ajay yadav

Updated on 23-Dec-2019 06:24:14

381 Views

There are many ways defined to reverse a string in the C++ code including stack, In-place, and iteration. In this sample, a simple string will be reversed iteratively with the following algorithm;AlgorithmSTART    Step-1: Input the string    Step-2: Get the length of the string using length() method    Step-3: ... Read More

Reverse a string using the pointer in C++

Ajay yadav

Ajay yadav

Updated on 23-Dec-2019 06:14:43

3K+ Views

This article reverse a string using the pointer in C++ coding, First, it calculates the length of a pointer to string then run a for loop in decrement order to display the reverse string as follows;Example Live Demo#include #include using namespace std; int main(){    char *str="ajaykumar";    coutRead More

Sort an Array of string using Selection sort in C++

Ajay yadav

Ajay yadav

Updated on 23-Dec-2019 06:09:48

1K+ Views

The Selection Sort algorithm sorts an exhibit by more than once finding the base component from the unsorted part and putting it toward the start. In each emphasis of determination sort, the base component from the unsorted subarray is picked and moved to the arranged subarray.Example Live Demo#include #include ... Read More

stable_sort() in C++ STL

Ajay yadav

Ajay yadav

Updated on 23-Dec-2019 06:03:30

223 Views

The stable_sort method of STL first sorts the components with name as the key in ascending order and afterward the components are arranged with their segment as the key. Moreover, The stable_sort() calculation is viewed as steady in light of the fact that the overall request of comparable components is ... Read More

Stein’s Algorithm for finding GCD in C++

Ajay yadav

Ajay yadav

Updated on 23-Dec-2019 06:01:17

414 Views

Stein's Algorithm used for discovering GCD of numbers as it calculates the best regular divisor of two non-negative whole numbers. It replaces division with math movements, examinations, and subtraction. In the event that both an and b are 0, gcd is zero gcd(0, 0) = 0. The algorithm for GCD(a, ... Read More

Stringstream in C++ programming

Ajay yadav

Ajay yadav

Updated on 23-Dec-2019 05:36:07

935 Views

This sample draft calculates the total number of words in a given string as well as counts the total occurrence of a particular word using stringstream in the C++ programming code. The stringstream class partners a string object with a stream enabling you to peruse from the string as though ... Read More

Remove vowels from a String in C++

Ajay yadav

Ajay yadav

Updated on 29-Nov-2019 11:13:00

4K+ Views

The following C++ program illustrates how to remove the vowels (a, e, i, u, o) from a given string. In this context, we create a new string and process input string character by character, and if a vowel is found it is excluded in the new string, otherwise the character ... Read More

Validate IP Address in C++

Ajay yadav

Ajay yadav

Updated on 29-Nov-2019 11:08:26

3K+ Views

This article is serving the purpose of validating the correct IP (internet protocol) address by virtue of C++ code programming. The IP address is a 32-bit dot-decimal-notation, broken into four decimal numbers segments ranging from 0 to 255. Furthermore, these numbers are separated by dots consecutively. The IP address serves ... Read More

Replacing words with asterisks in C++

Ajay yadav

Ajay yadav

Updated on 29-Nov-2019 11:04:24

691 Views

This aim of this program to replace a particular word with asterisks in the string by using the c++ programming code. The essential function of vector and string class essay a key role to achieve the prospective results. The algorithm is as follows;AlgorithmSTART    Step-1: Input string    Step-2 Split ... Read More

Reverse a link list using stack in C++

Ajay yadav

Ajay yadav

Updated on 29-Nov-2019 10:59:50

204 Views

Linked list allocates memory dynamically, is used to implement a stack. This program showcase the reversal of the link list in c++ programming. Here, the aspirant can adopt the following approach to get the expected results. The algorithm is as follows;AlgorithmSTART    Step 1: create an empty stack of type ... Read More

Advertisements