Programming tricks
Saturday, May 21, 2011
Quick sort as a divide and conquer sorting technique.
Quicksort is a fast sorting algorithm, which is used for sorting list of data in ascending or descending order. The average complexity of sorting for a quick sort technique is O(nlogn).... To know more Click here .
Monday, May 16, 2011
Travelling Salesman problem in c
Travelling Salesman problem is a classic problem, that is used to find out the minimum cost in which a salesman can visit all the given cities. The problem complexity wise is NP. But approximate solutions to the problem are possible. A greedy approach using Kruskal's algorithm or back tracking algorithm can be used to reach to the solution. To view code for TSP using back tracking Click Here.
Friday, May 13, 2011
Program to eat up system's memory.
The program uses the concept of stack memory used in recursive program. To read more and view the code Click here
Code to find the nth smallest number in linear time.
The program here uses technique of partitioning used in quick sort. Each time out of two partitions, one partition is rejected. With just one smaller partiton to work upon. To Know more and view code Click here.
Subscribe to:
Posts (Atom)