Presentation is loading. Please wait.

Presentation is loading. Please wait.

CC214 – Data Structures and Algorithms. LESSON 6: 2.

Similar presentations


Presentation on theme: "CC214 – Data Structures and Algorithms. LESSON 6: 2."— Presentation transcript:

1 CC214 – Data Structures and Algorithms

2 LESSON 6: 2

3 Topic Outline: ✘ Concept of Sorting ✘ Types of Sorting Algorithm ✘ Applications of Sorting Algorithm ✘ Implementation of Sorting Algorithm (C++) 3

4 Lesson Objectives: ✘ Explore the ideas and concepts of Sorting Algorithm relative to Data Structures. ✘ Apply Sorting Techniques into computer – based and coding problem. ✘ Compare and contrast the procedures used on each Sorting Techniques. ✘ Provide real – world examples of Sorting Algorithms from daily life activities. 4

5 5

6 Concept of Sorting: Sorting refers to arranging data in a particular format. Sorting Algorithm specifies the way to arrange data in a particular order. Most common orders are in numerical or lexicographical order. 6

7 Concept of Sorting: Sorting is an algorithm that arranges the elements of a list in a certain order [either ascending or descending]. The output is a permutation or reordering of the input. 7

8 Concept of Sorting: The importance of Sorting lies in the fact that data searching can be optimized to a very high level, if data is stored in a sorted manner. Sorting is also used to represent data in more readable formats. 8

9 Concept of Sorting: Following are some of the examples of sorting in real-life scenarios: ✘ Telephone Directory – The telephone directory stores the telephone numbers of people sorted by their names, so that the names can be searched easily. ✘ Dictionary – The dictionary stores words in an alphabetical order so that searching of any word becomes easy. 9

10 Concept of Sorting: Increasing Order (Non – Decreasing Order) A sequence of values is said to be in Increasing Order, if the successive element is greater than the previous one. For example, 1, 3, 4, 6, 8, 9 are in increasing order, as every next element is greater than the previous element. 10

11 Concept of Sorting: Decreasing Order (Non – Increasing Number) A sequence of values is said to be in Decreasing Order, if the successive element is less than the current one. For example, 9, 8, 6, 4, 3, 1 are in decreasing order, as every next element is less than the previous element. 11

12 12

13 13

14 14

15 Types of Sorting Algorithms: A. Sorting by Insertion 1. Straight Insertion 2. Shell Sort B. Sorting by Selection 1. Straight Selection 2. Heap Sort 15

16 Types of Sorting Algorithms: C. Sorting by Exchange 1. Bubble Sort 2. Quick Sort D. Sorting by Distribution 1. Radix Sort E. Sorting by Merging 1. Merge Sort 16

17 17 Thanks! Merry Christmas and Happy New Year!! Any Questions?


Download ppt "CC214 – Data Structures and Algorithms. LESSON 6: 2."

Similar presentations


Ads by Google