- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7346 Articles for C++
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
119 Views
We will use the g++ header file to compile the code in C++ compiler. g++ is a Linux based header file that is used in C++ to compile the code of policy based data structure. The policy based data structure are such structures used for high performance and flexibility of the code. As these data structures are so resourceful that we can use them for many functions like searching the index of an element, inserting the element into the index position, removing the element from the range of index, etc. Example Let’s take an example of inversion count − Suppose ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
363 Views
C++ has a predefined function substr to return the portion of string and compare function to check the sequence of characters. The suffix means the group of characters added to the end of the word. In this article, we are going to find the strings that end with a given suffix. Let us understand the example of suffix by taking some of the strings − Tutorialspoint − The characters n and t represent the suffix. Tutorix − The characters r, i, and x represent the suffix. Note that, the length of the reverse of some characters in ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
864 Views
C++ has a macro which is defined as a piece of code or desired value and it will use repetitively again and again whenever the user wants. The Floyd Warshall Algorithm is the process of finding the shortest path between all pairs of vertices in a given weighted graph. This algorithm follows the dynamic programming approach to find the minimal weightage graph. Let us understand what is Floyd Warshall Algorithm with the help of diagrams − Take vertex 1 as the source and vertex 4 as the destination and find the shortest path between them. We have seen that ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
322 Views
In C++ we have a pop() function to remove the element from the beginning. The top() function returns the reference of the first element of the priority_queue whereas the push() function is used to insert an element on it. A priority queue is a part of the data structure that manages elements based on their values. In this article, we will learn the minimum cost of reducing an array by merging any adjacent element repetitively. Let's take an example from this article − We will draw the array of size 4 and add the adjacent element repetitively. Syntax The ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
229 Views
A string range query is the range of characters present in the string where a character starts from the index[0] and the last index[] may be specified according to the length of a given string. In this article, we are going to learn how string range queries count the number of distinct characters with their updates. Let’s take an example of counting the number of distinct characters of a string with its update. string = “tutorialpoint” // original string The given string is the length of 12. So the count is 13(counting always starts from 1). If we ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
93 Views
In C++ we have a vector header file that can change the size of an array during runtime. In this article, we are going to learn the concept of the number of times an array can be partitioned repetitively into subarrays with equal sum. Let’s take an example to show an array partition with an equal sum. The given array is {1, 2, 3, 4, 2} and we are subdividing the array into two parts − {1, 2, 3}- The total sum of each index of an array is 6. {4, 2}- The total sum of each index of an ... Read More
![Tapas Kumar Ghosh](https://www.tutorialspoint.com/assets/profiles/641996/profile/60_877006-1681905500.jpg)
90 Views
A graph that does not contain any cycles or loops is called a non-cycle graph. A tree is a non-cycle graph in which every node is joined to another unique node. A non-cycle graph is also known as an acyclic graph. Difference between cycle graph and non-cycle graph − Cycle Graph Non-Cycle graph The graph forms a closed loop. The graph doesn’t form a closed loop. The graph doesn’t contain a depth loop The graph contains each depth. Example 1 let’s take an example of a cycle graph − A Cycle ... Read More
![Rudradev Das](https://www.tutorialspoint.com/assets/profiles/631515/profile/60_2136687-1680239346.jpg)
1K+ Views
Paging is a memory management process related the operating systems. It stores or retrieve some process data from the secondary data storage into the primary data storage or memory by using the page segement. The paging process happens when the process encounters any fault in a page and we can not use a new free page to satisfy the allocation process here. The LRU process generates the particular need of a replacement algorithm. It decides which page needs to be replace when a process produce a new page. Let us take an example – Input taken for the process − ... Read More
![Rudradev Das](https://www.tutorialspoint.com/assets/profiles/631515/profile/60_2136687-1680239346.jpg)
2K+ Views
The Least Frequently Use aka LFU is a concept of page memory management, can also be used as a replacement algorithm. This process take a lead we the particular page needs a replacement when a new page is on the way by the process. LFU is one of the page replacement policy where an user can replace the least frequency of a particular operation page. If the page frequency is same in a process, then it will come first on the replacement list. Here we will take a page sequence of an array of pages denoted as pages[], whose length ... Read More
![Diksha Patro](https://www.tutorialspoint.com/assets/profiles/586222/profile/60_1257779-1673957458.jpeg)
1K+ Views
A synchronization method called Lamport's Bakery method addresses the critical section issue in parallel computing systems. When more than one process needs to utilize a shared resource at once but only one process can do so, this is known as the critical section problem. To avoid conflicts and guarantee the accuracy of the system, the challenge is to make sure that each process uses the resource in a way that is mutually exclusive. Pseudo code for Lamport's Bakery Algorithm Here the Pseudo code for Lamport’s Bakery Algorithm − Initialize an array, called choosing, of size N, where N is ... Read More