Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


C++ Programming Code Examples

C++ > Computer Graphics Code Examples


Program demonstrates the implementation of Randomized Binary Search Tree. Function to check if tree is empty. And then make the tree logically empty. Functions to insert data.


Function to check if "tree is empty". Function to count number of "nodes recursively". And function to search for an element. Function to search for an element recursively. Function


Make the "Tree Logically" empty, insert data and get "height of node". Function to max of left/right node, insert data recursively. Rotate binary tree node with left child. Rotate binary

For a general weighted graph, we calculate single source shortest distances in "O(VE)" time using 'Bellman-Ford Algorithm'. For a graph with no negative weights, we can do

Program to find the "Area of Ploygon" using "Slicker Algorithm". algorithm assumes the usual mathematical convention that positive y points upwards. Enter the number of points

Program demonstrates the implementation of Sorted linked list to Balanced BST. Counts the number of nodes in linked list. Construct balanced BST and returns root of it. Returns



Program demonstrates the implementation of Ternary Seach Tree. Create a new ternary search tree node. And insert a new word in a Ternary Search Tree. Search a given word in

C++ program implements the ternary tree, is a tree data structure in which each node has at most three "child nodes", distinguished as "left", "mid" and "right". Nodes with children

The Edmonds_Karp Algorithm which is used to compute the maximum flow between the 'sink and source vertex'. It is the same as the "Ford - Fulkersson" Algorithm except that it

The chromatic index of the simple graph can be either 'maxDegree' or maxDegree+1. The chromatic index is the maximum number of color needed for the 'edge coloring' of graph.



Program demonstrates the implementation of Trie. Trie node base declaration. Trie node declaration. Trie class declaration. Insert trie node. Destroy trie. Trie traversal. Clustering


This is a C++ Program to perform "dictionary" operations in binary search tree. In computer science, a binary search tree, sometimes also called an ordered or "sorted binary tree", is a

In graph theory, an "edge coloring" of a graph is an assignment of colors to the edges of the graph so that no two adjacent edges have the same color. Any "2 edges" connected to same

This algorithm takes the input of the number of vertexes. Construct a complete graph for v vertex. So it assigns a color to edges without assigning the same color to 2 adjacent edges.

Takes the input of the number of 'vertexes' & the number of edges in the graph. It takes the input of vertex pairs for the given number of edges. It generates a line graph for the given
The problem takes a bipartite graph as input and outputs colours of the each vertex after 'coloring the vertices'. The "Bipartite Graph" is a graph in which the set of vertices can be
Give all its neighbouring colours a vertex, but before that keep a check on used colours and unused colours. 'Only assign', unused colours to the upcoming vertex. The problem takes a
A tree rotation moves one node up in the tree and one 'node down'. It is used to change the shape of the tree, in particular to decrease its height by moving smaller subtrees down and
C++ Program to "Print Preorder Traversal" of a given binray tree without using recursion. A binary tree node has data, left child and right child. "Helper Function" that allocates a new
In discrete mathematics, tree rotation is an operation on a binary tree that changes the structure without interfering with the order of the elements. A tree rotation moves one
Two functions in this method. One is to print all nodes at a given level ("printGivenLevel"), and other is to "print level order traversal" of the tree ("printLevelorder"). printLevelorder
Program to print the kind of rotation that is performed when an 'Element is inserted' or deleted from tree. In Discrete Mathematics, tree rotation is an operation on a binary tree
C++ Program demonstrates the Removal of All the nodes which don't lie in any Path with Sum greater than or equal to K. Create a new 'Binary Tree node' with given data. Truncates
Algorithm takes the input of the number of vertex & edges. Take the input of connected vertex pairs. Print the graph using 2D arrays. A function to "print the matrix". Print 1 if the
This algorithm takes the input of the number of vertex. For each pair of vertex ask whether they're connected or not. Print the incidence matrix. Function to print the incidence matrix
Algorithm represents a 'graph' using Linked list. The time complexity of this algorithm is "O(e)". This algorithm takes the input of the number of vertex and edges. Take the input

Page 1 Page 2 Page 3 Page 4 Page 5 Page 6