Thursday, February 10, 2011

1. Selection Sort

The algorithm of selection sort finds the minimum value, swaps it with the value in the first position, and repeats these steps for the remainder of the list. The idea of algorithm is quite simple. Array is imaginary divided into parts – sorted and unsorted. At the beginning, sorted part is empty, while unsorted part contains whole array. At every step, algorithm finds minimal element in the unsorted part and adds it to the end of the sorted part. Algorithm stops when unsorted part becomes empty.

2. Insertion Sort

Insertion sort is a simple sorting algorithm that is relatively efficient for small lists and mostly-sorted lists. The algorithm is almost the same with the selection sort. It has two imaginary parts – sorted part that contains the first or the last element of the array, and unsorted contains the rest element. The algorithm is comparing the element of unsorted part into the elements of the sorted part. The element of the unsorted part is placed in the correct position at the sorted part. The algorithm stops when the unsorted part is empty.

3. Bubble Sort

Bubble sort is a simple sorting algorithm. The algorithm starts at the beginning of the data set. It compares the first two elements, and if the first is greater than the second, then it swaps them. It continues doing this for each pair of adjacent elements to the end of the data set. It then starts again with the first two elements, repeating until no swaps have occurred on the last.

4. Shell Sort

Shell sort improves upon bubble sort and insertion sort by moving out of order elements more than one position at a time. One implementation can be described as arranging the data sequence in a two-dimensional array and then sorting the columns of the array using insertion sort.


Reference: http://www.algolist.net/Algorithms

Friday, February 4, 2011

Empirical Analysis

Algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Then the word “empirical” refers to the information gained by means of observation, experience, or experiment. Therefore, empirical algorithm helps us to analyze the information about the particular algorithm.

There are two branches of empirical algorithm. First is the empirical analysis that deals with the characterization of the behavior of algorithms. Second is the algorithm engineering focuses on empirical methods for improving the performance of algorithms.

Analysis of algorithm

Algorithm analysis is a field of computer science that is dedicated to understand the complexity of algorithm. It also provides theoretical estimates for the resource needed by any algorithm which solves a given computational problem. It helps us to know the efficiency or running time of an algorithm as a function relating the input length to the number of steps or storage location and capacity.

Bog-oh notation

Describe the limiting behavior of a function when the argument tends towards a particular or infinity, usually in terms of simpler function.

++Referrence: Wikipedia.com++