C++ Articles

Page 436 of 597

C++ Program to count of array elements greater than all elements on its left and at least K elements on its right

Rudradev Das
Rudradev Das
Updated on 06-Apr-2023 738 Views

A string is an object, which represents a sequence of data characters. The strings are the data container which always represented as a text format. It also used to concept, compare, split, join, replace, trim, length, intern, equals, comparison, substring operation. K largest(or smallest) elements in an array using Quick Sort partitioning algorithm. Here is an array R[] with N number of distinct integers. The task is to find that particular element which are strictly greater than all the elements preceding it and strictly greater than at least K elements on its right. The problem states that an array ...

Read More

Applications, Advantages and Disadvantages of Deque

Rudradev Das
Rudradev Das
Updated on 06-Apr-2023 3K+ Views

Deque or double ended queue is a sequential linear collection data queue that provides the function like a double-ended queue. In this data structure the method does not follow the First In First Out (FIFO) rule for data treatment. This data structure is also known as double-ended queue because the elements are inserted to the end of the queue and removed from the front. For a deque we can add and remove data only from both ends. The time complexity of the deque operation is O(1). There are two types of deque − Input Restricted Restriction at a ...

Read More

Maximize value of coins from adjacent row and columns cannot to be collected

Rudradev Das
Rudradev Das
Updated on 05-Apr-2023 326 Views

Dynamic programming is an optimization algorithmic technique to solve the particular problems by splitting them into some simple sub problems. It is a procedure by which we can combine the quality, condition, or fact of a complete search for a greedy algorithm being exact and accurate. But this method is an oxymoron itself because it comes with a great advantage and that is also its biggest disadvantage and limitation too. We can divide a problem into some sub problem but we can't divide the sub problems again. They should be solvable by its own. The concept of the sub problems ...

Read More

Reverse each word in a linked list Node

Rudradev Das
Rudradev Das
Updated on 05-Apr-2023 487 Views

A linked list is a chain alike linear data structure, where the elements are not saved at memory in an adjacent manner, unlike array. In a particular linked list, the elements are linked with the next element by a pointer. In simple words; a linked list is a series of some data containers where we can find a path way or a reference link in those elements to the next node. There is a head pointer present as the first element in a linked list. If the first node of that particular list is empty then it points nothing or ...

Read More

Minimum Changes to string to make all substrings distinct

Rudradev Das
Rudradev Das
Updated on 05-Apr-2023 1K+ Views

A string is a particular object, which represents a sequence and flow of data characters. The strings are the data container which always represented as a text format. It also used to concept, compare, split, join, replace, trim, length, intern, equals, comparison, substring operation. A substring() is a data refining process, which extracts the saved data of between two positions from start to end. A substring () does not change the original string. In a data set when we have different characters, they can be denoted as distinct data elements. For example: 'a' and 'r' are distinct while 'r' ...

Read More

Function to copy string (Iterative and Recursive)

Rudradev Das
Rudradev Das
Updated on 05-Apr-2023 696 Views

In a C++ environment, iteration statement is a compound or cause statement which can be executed zero or more than one at a time. This process is subjected to a loop termination process. The statement executes in a particular order when there is a presence of break statement or the continuation of a statement. There are four types of iteration present in C++ - While Do For Range-based for Every loops mentioned here iterates a particular condition until its termination. The expression evaluates as zero when the statement. The iteration statements can't be considered as declaration. In ...

Read More

Transform a string such that it has abcd..z as a subsequence

Rudradev Das
Rudradev Das
Updated on 05-Apr-2023 247 Views

Transforming a string aka string transformation is an operation in C++ by which the result stores in an output array after the execution of the whole process. In C++ there is a function called "transform()", present in the directory of the C++ environment by which we can transform a string into a new one. There are two forms of this transform function − Unary operation Operation applies on the every element of the input array. After the operation being done the result will store in an output array. Binary operation Operation applies on each element ...

Read More

Strong Password Suggester Program

Rudradev Das
Rudradev Das
Updated on 05-Apr-2023 819 Views

Every year on 7th May the worldwide organizations remind there users about the significance of a strong password. As per the tech giant Google; 24% of their end users have used the word "password" or "Qwerty" as their account password. While, only 34% from their total users change their account passwords in a frequent manner. In this tech-forward world today, every login attempt has a chance of a cyber criminal attack. But many people now a days still using the weak passwords for their professional and personal accounts. Here we will discuss and check, whether the created passwords ...

Read More

C++ Program to Print Spiral Pattern of Numbers

Arnab Chakraborty
Arnab Chakraborty
Updated on 05-Apr-2023 2K+ Views

Displaying numbers in different formats comes under fundamental coding problems to learn different concepts of coding like conditional statements and looping statements. There are different programs where we have printed special characters like stars to make triangles or squares. In this article, we will print numbers in spiral form like a square in C++. We will take the number of lines n as input, then starting from the top-left corner we will move towards the right, then down, then left and then up, then again towards the right, and so on. Spiral Pattern with Numbers 1 2 ...

Read More

C++ Program to Get Input from the User

Arnab Chakraborty
Arnab Chakraborty
Updated on 04-Apr-2023 2K+ Views

While writing a program in any language, taking input is a fundamental job that we do in almost all programs. Sometimes we take input directly from the console or take the inputs from the files. Taking inputs from the files is somewhat beneficial because it does not require us to type inputs again and again, or sometimes we can save some good input test cases into a file. However, in this article, we are going to focus on console-based inputs. We will learn different techniques to get inputs from the user in C++. There are a few different approaches to ...

Read More
Showing 4351–4360 of 5,962 articles
« Prev 1 434 435 436 437 438 597 Next »
Advertisements