CHAPTER 12

LIST MANIPULATION

CHAPTER OUTLINE

12.1 Sorting

12.2 Searching

12.3 A Case Study

12.4 More on Sorting

In several applications, we need to sort data or search for some item of interest in the given data. For example, we may be required to arrange the answer sheets in the order of roll number, to arrange the student data on the basis of marks, to search for a phone number in a telephone directory, or to find an answer sheet with a given roll number. We already know that given the roll number of a student, it is easier to find his/her answer sheet if the answer sheets are arranged according to roll number. Similarly, it is easier to find how many students have secured pass marks, if the answer sheets are arranged according to marks. The ...

Get Python Programming: A modular approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.