C Programming Code Examples
C > Small Programs Code Examples
Implement Nearest Neighbour Algorithm -
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
C Program Codes Parse Custom httpd Log -
C Parse custom httpd log. Get unresponsibly wild with pointers. Grow a tree for world peace. Allocate mem for ptr array. Read btree into array. Qsort the array. Print the result.
C++ Prim's Algorithm Finds the Minimum -
Find the minimum spanning tree of the given graph using Prims algorihtm. This algorithm is a "greedy algorithm" that finds a minimum spanning tree for a "Connected Undirected"
Test Using DFS Whether a Directed Graph -
This C++ Program checks whether a directed graph is weakly connected or not. We can do "DFS" V times starting from every vertex. If any DFS, doesn't visit all vertices, then graph
Program Convert Binary Decimal Number -
To improve "readability of program" make a separate function and function should return the "resultant number". In main function user enters input number. Calls the function, pass
C Computing the Product of Two Matrices -
Code computes the product of two matrices. This program accepts the 2 matrices and then find the product of 2 matrices. Develop functions to read a matrix, display a matrix
C++ Program Code Implement Radix Sort -
In this algorithm Sorting of Data is done from least significant digit to most significant digit. Here we need 10 different spaces labeled 0 to 9. Assume we have "n" Number of inputs. Let
C Language Codes & Arithmetic Operators -
Arithmetic operator performs mathematical operations such as addition, subtraction and multiplication on numerical values (constants and variables). C Program to demonstrate...