CHAP13 - Chapter 13 Array-Based Lists Chapter13 ARRAYBASEDLISTS CHAPTER GOALS To be able to insert a value into a list To be able to delete a

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
14 Chapter 13 Array-Based Lists Chapter 13 ARRAY-BASED LISTS CHAPTER GOALS To be able to insert a value into a list. To be able to delete a specific value from a list. To be able to search for a specific value in a list. To be able to sort the components of a list into ascending or descending order. To be able to insert a value into a sorted list. To be able to delete a specific value from a sorted list. To be able to search for a specific value in a sorted list using a linear search. To be able to search for a specific value using a binary search. To be able to declare and use C strings. CHAPTER OUTLINE I. The List as an Abstract Data Type II. Unsorted Lists A. Basic Operations B. Insertion and Deletion C. Sequential Search D. Sorting III. Sorted Lists A. Basic Operations B. Insertion C. Sequential Search D. Binary Search E. Deletion Theoretical Foundations : Complexity of Searching and Sorting IV. Understanding Character Strings A. Initializing C Strings B. String Input and Output C. C String Library Routines D. String Class or C Strings? V. Problem-Solving Case Study : Exam Attendance VI. Testing and Debugging A. Testing and Debugging Hints VII. Summary
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 13 Array-Based Lists GENERAL DISCUSSION Chapter 13 differs from those preceding it in that most of the new concepts are algorithmic rather than language oriented. The text basically presents a series of algorithms, although it begins with a discussion of the List abstract data type. The first algorithm is the sequential search in an unordered list. The main concept here is that the search loops through an array, exiting when either a match is found or the end of the array is reached without a match. This algorithm is very easy to explain. It follows directly from the standard array processing techniques that were introduced in Chapter 12. The only difference is that the search loop may terminate before the last element of the list has been examined. The text also introduces the idea of efficiency and presents a technique for improving the efficiency of the search namely, storing a copy of the search item at the end of the list before the search begins. The second algorithm is the selection sort. The new concepts here are reordering a list in place and swapping two values. The Hard Parts section addresses some of the issues involved in teaching this topic. Next is the sequential search of an ordered list, in which the new idea is that the absence of a value can be determined before the end of the list is reached. This technique is fairly easy to introduce. However, some students may need to see several examples before they believe that the search can stop in the middle of the list when the position of the target value has been passed. Inserting into an ordered list, which follows quite naturally from searching an ordered list, adds the concept
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/13/2011 for the course CSC 240 taught by Professor Lebre during the Spring '04 term at Moraine Valley Community College.

Page1 / 20

CHAP13 - Chapter 13 Array-Based Lists Chapter13 ARRAYBASEDLISTS CHAPTER GOALS To be able to insert a value into a list To be able to delete a

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online