Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 (16M) Sorting and Searching

Similar presentations


Presentation on theme: "Chapter 2 (16M) Sorting and Searching"— Presentation transcript:

1 Chapter 2 (16M) Sorting and Searching
Visit for more Learning Resources

2 Sorting: It is a Process by which a collection of items are placed into ascending order or in descending order. Sorting is the operation of arranging data or elements in some given order, numerically or alphabetically. The sorting is classified into two categories. 1. Internal Sorting: 2. External Sorting:

3 Internal Sorting: In this sorting technique, all the data is stored in main memory only . The data can be accessed randomly. Access of data will extremely fast. This method is used when data items are less. Example. Bubble Sort Insertion Sort Selection Sort Quick Sort

4 2. External Sorting In this sorting, the data to be sorted is moved from secondary storage to main memory. It is more time consuming to move records into different location. This method is used when data items are larged. Access of data element is slow. Examples: K-way Merging, Balanced Merge Sort

5 Sorting Stability A sorting algorithm is said to be stable if two objects with equal keys appear in the same order in sorted output as they appear in the input unsorted array. Some sorting algorithms are stable by nature like Insertion sort, Merge Sort, Bubble Sort, etc. And some sorting algorithms are not, like Heap Sort, Quick Sort, etc.

6

7 Sorting Techniques: Sorting Techniques: Bubble Sort Insertion Sort
Selection Sort Quick Sort Merge Sort Radix Sort Shell Sort For more detail contact us


Download ppt "Chapter 2 (16M) Sorting and Searching"

Similar presentations


Ads by Google