- 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++
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
56 Views
In this problem, we will check whether we can convert the string alpha1 to alpha2 by inserting the same characters between any two same characters of the given string. We will use the run length encoding algorithm to solve the problem, which counts the frequency of the contiguous characters. Problem statement − We have given two strings named alpha1 and alpha2. We need to check whether we can convert the string alpha1 to alpha2 by performing an unlimited number of below operations. Choose any index, and the character at the current and previous index is the same, insert the ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
120 Views
In this problem, we will check whether all characters are present continuously in the given string. We will use the map data structure to solve the problem. The map will keep track of the last index of the particular character, and based on the last index of the current character, we will decide whether the string contains contiguous characters. Problem statement – We have given a string alpha of length N containing the lowercase and uppercase alphabetical characters. We need to check whether the given string is contiguous. The string is contiguous only if it contains all characters as a ... Read More
![Diksha Patro](https://www.tutorialspoint.com/assets/profiles/586222/profile/60_1257779-1673957458.jpeg)
345 Views
The computer system must convert a user's high-level programming language program into machine code so that the computer's processor can run it. Multistep processing is the term used to describe the several processes involved in converting a user program into executable code. A user program will often go through a number of various phases during its multistep processing, including lexical analysis, syntactic analysis, semantic analysis, code creation, optimization, and linking. In order to convert the user program from its high-level form to machine code that can be run on a computer system, each of these stages is essential. User ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
338 Views
Breadth To begin with, Look (BFS) may be a chart traversal calculation utilised to investigate hubs in a chart in a breadthward movement. The normal usage of BFS utilises a line information structure to keep track of hubs to come. In any case, it is conceivable to execute BFS without utilising an unequivocal line by utilising other information structures. One elective approach to actualizing BFS without a line is to utilise two clusters or records: one for the current level of hubs being investigated and another for the next level of hubs to be investigated. At first, the current level ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
306 Views
Finding the shortest route between a source vertex and a target vertex in a graph with precisely K edges is one of the most typical graph traversal issues. The objective is to find the shortest path with minimum weight and exactly K edges. This issue can manifest in a number of practical contexts, including transportation networks, routing protocols, and resource allocation. Dynamic Programming (DP), and Dijkstra's Algorithm are just some of the strategies that may be used to attack this issue. The shortest path under the given constraints can be found using one of many methods. Dijkstra's Algorithm takes into ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
451 Views
The Minimum Number of Colours Required to Colour a Graph is a fundamental graph theory issue that includes colouring vertices so that no two neighbouring vertices have the same colour. Determine the least amount of colours needed for a valid colouring.Greedy Colouring is a simple and commonly used technique that colours vertices one by one based on their neighbours. Backtracking also carefully analyses all colour allocations. DSatur−based graph colouring prioritises vertices with the highest degree and saturation. Methods Used Greedy colouring Backtracking Graph colouring Greedy Colouring Method The Greedy Colouring technique makes graph colouring easy. It colours the ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
196 Views
The minimum cost to invert edges in order to have a way between each match of hubs alludes to finding the slightest costly way to alter the course of edges in a chart. The objective is to guarantee that there's a way to interconnect any two hubs within the chart. This may involve changing the course of a few edges to set up the network. The least taken toll speaks to the smallest cumulative weight related to reversing the edges. By minimising the fetch, we are able to accomplish the specified result of having a way between all sets of ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
50 Views
To reduce the number of colours needed and to avoid having the edges form a cycle with the same colour, you can use a chart colouring approach. The goal is to map colours to vertices such that no two adjacent vertices connected by an edge have the same colour. By recognising cycles within the chart, we are able to guarantee that the edges shaping the cycle are allotted diverse colours. This requires navigating the chart using strategies like Depth−First Look (DFS) or Breadth−First Look (BFS) and applying backtracking to backtrack and reassign colours when essential. The objective is to discover ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
117 Views
The concept of a triangle−free graph, in which no collection of three vertices forms a triangle, is crucial to the study of graph theory. It's amazing to consider how many edges an N−vertex graph may have and yet be triangle−free. Mantel's theorem offers the elegant solution to this issue.The maximum number of edges in a graph may be determined via Mantel's theorem without generating any triangles. Methods Used Mantel’s algorithm Mantel’s Algorithm Mantel's theorem is a famous conclusion in graph theory that sheds light on how many edges a graph without triangles may have. According to this theory, ... Read More
![Ayush Singh](https://www.tutorialspoint.com/assets/profiles/680995/profile/60_3152495-1689250670.png)
229 Views
The goal here is to determine the path with the fewest hops from a given starting point to the endpoint of the whole graph. This distance may be computed using a variety of methods, including those specifically designed for graph traversal (like Breadth−First Search) and shortest path discovery (like Dijkstra's algorithm). Methods Used Breadth first search Dijkstra's algorithm Breadth first search method All graph vertices are traversed using the breadth−first search algorithm. A source node's neighbours are all visited before moving on to the next stage. In an unweighted graph, BFS determines the shortest path. By applying BFS ... Read More