
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 7197 Articles for C++

123 Views
The article codes points to the number of sets in a chart such that the way between each combine contains two indicated vertices, A and B. It employs a Profundity To begin with, use the Look (DFS) approach to analyse the network of the chart and tally the required pairs. The calculation works by performing two isolated DFS traversals. Within the first traversal, it evacuates vertex B and calculates the number of vertices that can still be reached from vertex A. So also, within the moment traversal, it evacuates vertex A and tallies the number of vertices reachable from vertex ... Read More

160 Views
The diploma of a node withinside the idea of graphs is the full variety of edges that join it. Finding the nodes in a graph with the very best and lowest diploma may monitor critical information about the hyperlinks and shape of the network.We will examine three approaches to resolving this issue utilising CPP algorithms in this article. We will go over the algorithm for each method, offer related code execution, and show off each approach's unique results. Methods Used Brute Force Approach Priority Queue Adjacency List Brute Force The brute force method entails counting the degrees of ... Read More

145 Views
Non−reachable nodes are nodes in a chart that cannot be reached from a particular source hub. They are hubs that don't have any way of interfacing with the source hub inside the given chart. The recognisable proof of non−reachable hubs makes a difference in determining the detached or disconnected substances inside the chart. Calculations like breadth−first look (BFS) or depth−first look (DFS) can be utilised to navigate the chart and effectively stamp the gone−by hubs, subsequently encouraging the distinguishing proof of non−reachable hubs. Analysing and understanding non−reachable hubs is important in evaluating organised networks, recognising crevices in data or networks, ... Read More

178 Views
The product of the least edge weight between all sets of a tree is gotten by finding the least weight edge for each conceivable match of vertices within the tree and, after that, increasing all these least weights together. This esteem speaks to the smallest conceivable toll or weight required to navigate the tree from any vertex to any other vertex. By considering the least weight of each edge, we guarantee that we find the most proficient way between any two vertices within the tree. The item of these least edge weights gives a compact degree of the general network ... Read More

713 Views
To print the way between any two hubs of a tree utilising Depth−First Look (DFS), we will navigate the tree and keep track of the way from the source hub to the target hub. DFS investigates the tree by going as deep as conceivable and recently backtracking. We begin DFS at the source hub and recursively visit its children. During navigation, we keep a way variable that stores the current way from the source to the current hub. In the event that we encounter the target hub amid the traversal, we print the way. This approach permits us to find ... Read More

607 Views
Prim's method and Kruskal's algorithm are two common approaches for locating MSTs in undirected graphs. However, these techniques cannot generate correct MSTs for directed graphs. This is due to the fact that directed graphs are not well−suited to the underlying assumptions and methods used by Prim's and Kruskal's algorithms. Prim’s Algorithm First, there's Prim's Algorithm, which involves adding edges to an expanding MST in a greedy fashion until all vertices are covered. A vertex inside the MST is linked to a vertex outside the MST through the edge with the lowest weight. Since all edges in an undirected graph can ... Read More

2K+ Views
A key concern in information technology, graph colouring has numerous applications in fields including scheduling, register assignment, and map colouring. An effective method for colouring graphs that makes sure nearby vertices have various shades while using fewer colours is the Welsh Powell algorithm. In this post, we'll examine 2 ways to use C++ algorithms to create the Welsh Powell algorithm. Methods Used Sequential Vertex Ordering Largest First Vertex Ordering Sequential Vertex Ordering In the first technique, colours are successively assigned to the vertices after they are arranged in decreasing order according to their degrees. This technique makes sure ... Read More

4K+ Views
The Travelling Salesman Problem (TSP) finds the shortest path between a collection of cities and the starting point. Due of its combinatorial nature and exponentially increasing number of routes as cities rise, it is a difficult task.The Genetic Algorithm (GA) is a genetically inspired heuristic. Emulating natural selection solves the TSP. The GA uses routes to illustrate prospective city tours.Selection, crossover, and mutation develop the population in the GA. Selection favours pathways with higher fitness, indicating quality or near to the ideal solution. Mutation introduces random modifications to explore new solution spaces, whereas crossover mixes genetic information from parent routes ... Read More

370 Views
In a coordinated and weighted chart, the issue of finding the most brief way with precisely k edges includes deciding the way that has the least weight while navigating precisely k edges. This will be accomplished by employing dynamic programming strategies, such as employing a 3D framework to store the least weight of all conceivable ways. The calculation repeats over the vertices and edges, overhauling the least weight at each step. By considering all conceivable ways with precisely k edges, the calculation distinguishes the most limited way with k edges within the chart. Methods Used Naive Recursive approach Dijkstra's ... Read More

109 Views
Go through the entire graph and compute the difference between the depth of each vertex and the number of vertices in its subtree to maximise the number of uncolored vertices that occur along the path from the root vertex to the coloured vertex. Find the uncolored vertex that has the greatest influence on the route by choosing the 'k' largest deviations. The sum of these parallaxes gives the maximum number of uncolored vertices. This method allows us to aggressively optimise the number of colourless vertices that occur, improving overall results and emphasising the importance of colourless vertices on the way ... Read More