Download presentation
Presentation is loading. Please wait.
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.
7
Sorting Techniques: Sorting Techniques: Bubble Sort Insertion Sort
Selection Sort Quick Sort Merge Sort Radix Sort Shell Sort For more detail contact us
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.