Debrief of PA04 - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Debrief of PA04

Description:

Debrief of PA04. What gave you the most trouble. Demo a solution. Intro to PA05. Summary: ... Add an enqueueQueue() method to this class that adds an entire ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 12
Provided by: csU57
Category:
Tags: debrief | pa04

less

Transcript and Presenter's Notes

Title: Debrief of PA04


1
Debrief of PA04
  • What gave you the most trouble
  • Demo a solution

2
Intro to PA05
  • Summary
  • Use the LinkedQueue representation
  • Add an enqueueQueue() method to this class that
    adds an entire queue to the end of a queue by
    working with node pointers rather than copying
    items one at a time (converts an O(n) operation
    to O(1))
  • Rework the RadixSort() to use this new method
  • Time the difference between PA04 and PA05

3
Chapter 16 - Overview of Lists
  • A list supports manipulation of items at any
    point within a linear collection
  • Some common examples of lists
  • Recipe, which is a list of instructions
  • String, which is a list of characters
  • Document, which is a list of words
  • File, which is a list of data blocks on a disk
  • Items in a list are not necessarily sorted
  • Items in a list are logically contiguous, but
    need not be physically contiguous in memory

4
Using Lists
  • Universal agreement on the names of the
    fundamental operations for stacks and queues but
    for lists, there are no such standards
  • The operation of putting a new item in a list is
    sometimes called add and sometimes insert
  • Broad categories of operations on lists
  • Index-based operations (today)
  • Content-based operations (today)
  • Position-based operations (Friday)

5
Index-Based Operations
  • Index-based operations manipulate items at
    designated indices within a list
  • In array-based implementations, these provide
    random access

6
Content-Based Operations
  • Content-based operations are based not on an
    index, but on the content of a list
  • Usually expect an item as an argument and do
    something with it and the list

7
So where were we with code??
8
Position-Based Operations
  • Position-based operations Performed relative to
    currently established position or cursor within a
    list
  • Allow user to navigate the list by moving this
    cursor
  • In some programming languages, a separate object
    called an iterator provides these operations
  • Places in which a positional lists cursor can
    be
  • Just before the first item
  • Between two adjacent items
  • Just after the last item

9
Position-Based Operations (continued)
10
Position-Based Operations (continued)
  • When a positional list is first instantiated or
    when it becomes empty, its cursor is undefined

11
Position-Based Operations (continued)
Write a Comment
User Comments (0)
About PowerShow.com