C++ Programming Code Examples
C++ > Computer Graphics Code Examples
This is a C++ Program to find the 'cliques' of size k in a a graph. An "Undirected Graph" is formed by a finite set of vertices and a set of unordered pairs of vertices, which are called
This is a C++ Program to check whether path exists between two given nodes. The idea is to run the 'Depth First search' algorithm with the given source node, if during 'dfs' we visit
Find the shortest path in linear time. This can be done by using the Dijkstra'a Shortestpath algorithm. A utility function to find the vertex with minimum distance value, from the set of
C++ Program to find the trnasitive closure of a given graph. In mathematics, the transitive closure of a binary relation R on a set X is the "transitive relation" R+ on set X such that R+
C++ Program finds vertex connectivity of a graph. A vertex in an undirected connected graph is an articulation point iff removing it disconnects the graph. 'Articulation points'
Displaying the 'transitive closure matrix' of a graph. The reachability of a particular node 'i' towards all node pairs ('i','j') is known as the transitive closure of a graph. So this matrix is
We create a queue for BFS. Mark the current node as visited and enqueue it. It will be used to get all adjacent vertices of a vertex. Get all adjacent vertices of the dequeued vertex s. If
This algorithm generates a undirected graph for the given "Degree Sequence". It does not include self-edge and multiple edges. So this algorithm 'takes the input' of the number of
Basically it implements on a big network. The time complexity of this algorithm is O(log(n)). This algorithm takes the input of the number of edges 'e'. It connects vertexes randomly &
Print all combination of a given length from the given array. Return if the currLen is more than the "required length". If currLen is equal to required length then "Print the sequence".
This C++ program, displays the traversal of a "binary search tree" in inorder,postorder and preorder mode using "Linked Lists". A linked list is an ordered set of 'data elements', each
Problem takes E edges as input and outputs vertex cover of the graph, implementing the following heuristic. There is no "Polynomial" time algorithm "invented up to date" to find
A B+ tree is an n-ary tree with a variable but often large number of "children per node". A B+ tree consists of a root, internal nodes and leaves. The root may be either a leaf or node
This C++ Language program implements the "Bellmanford Algorithm" is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in weighted
This C++ Program implements The "B-Tree" data structure. B-tree is a tree data structure that keeps "data sorted" and allows searches, sequential access & insertions in logarithmic
This C++ program code displays the Djikstra's Algorithm of finding shortest paths from one node to others using the concept of a priority queue. A "Priority Queue" is an abstract data
This is a C++ Program to find "shortest path". Dijkstra's algorithm is very similar to Prim's algorithm for minimum spanning tree. Like "Prim's MST", we generate a SPT with given
This C++ program, "using recursion", displays the number of cross edges in a graph. A cross edge is one in which a node points to another node which has already been fully visited. Int
This is a C++ Program to implement First Fit Decreasing for one dimensional objects and M bins. This is bin packing algorithm for first fit technique. Bubble Sort descending order
Implement Gift Wrapping algorithm to find convex hull in "Two Dimensional Space". In computational geometry, the gift wrapping algorithm is an algorithm for computing the
This is a C++ Program to implement Graham Scan algorithm. 'Graham's scan' is a method of computing the convex hull of a finite set of points in the plane with time complexity O(n
In computer science, An "Interval Tree" is an ordered tree data structure to hold intervals. Specifically, it allow one to efficiently find all intervals that overlap with any given interval
Program to implement "Jarvis March" to find convex hull. The idea of Jarvis's Algorithm is simple, we start from the 'leftmost point' (or point with minimum x coordinate value) and
Program demonstrates implementation of max-flow_min-cut_theorem. So returns true if there is a 'path from source' 's' to sink 't' in residual graph. Also fills parent[] to store the
This is a C++ Program to implement nearest neighbour algorithm to 'solve TSP'. This C++ program implements the travelling salesman problem which computes the minimum cost
Page 1 Page 2 Page 3 Page 4 Page 5 Page 6