Writing programs for sorting of a given set of numbers is one of the common programming tasks. Various types of sorting techniques like selection sort, inserting sort and quick sort are quite popular. Here C code for Insertion sort is being presented. The program is quite simple. Here, in each iteration, the elements are placed [...]
Archive for the ‘Codes’ Category
Java Sudoku Solver
Developing a Sudoku Solver program is perhaps the the only thing which is more interesting than solving a Sudoku puzzle.
The java code given below solves the puzzles in 4 steps :
1. If in any box, only 1 digit can be filled up, find that digit, fill up the box and proceed.
2. If a particular [...]
Make your C program run 50-100% times faster by using OpenMP
OpenMp has been around us for quite some time now and now we all know how simple it is to incorporate OpenMp pragmas to make the program run faster. Here a sample C code for matrix multiplication is been presented. The code contains the same operations, one being processed serially and the other one being [...]
C code for Converting while Loop to for Loop
Converting a while loop to for loop has always been an area of interest for the programmers. Many times, like while using OpenMp for parallelization of sequential C code, we have to convert all the while loops to for loop. The C code given below operates on the input file test.C and generates another file, for.C [...]
C Program for Matrix Multiplication
The ordinary matrix multiplication is the most often used and the most important way to multiply matrices. It is defined between two matrices only if the width of the first matrix equals the height of the second matrix. Multiplying an m×n matrix with an n×p matrix results in an m×p matrix.
The C program below show [...]

Posted in
Tags:

