CS163_Week4_topic2 - CS163: Data structures Week 4 topic 2:...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS163: Data structures Week 4 topic 2: Table abstract data type 6/2008 dbtien Data structures What will be discussed? Work by value rather than position May be implemented using a variety of data structures such as arrays (statically, dynamically allocated) linear linked lists non-linear linked lists Today, we begin our introduction into non- linear linked lists by examining arrays of linked lists! dbtien Data structures Table ADTs The ADT's we have learned about so far are appropriate for problems that must manage data by the position of the data (the ADT operations for an Ordered List, Stack, and Queue are all position oriented). These operations insert data (at the ith position, the top of stack, or the rear of the queue); they delete data (at the ith position, the top of stack, or the front of the queue); they retrieve data and find out if the list is full or empty. dbtien Data structures Table ADTs Tables manage data by its value! As with the other ADT's we have talked about, table operations can be implemented using arrays or linked lists. Valued Oriented ADTs allow you to: -- insert data containing a certain VALUE into a data structure -- delete a data item containing a certain VALUE from a data structure -- retrieve data and find out if the structure is empty or full. dbtien Data structures Table ADTs Applications that use value oriented ADTs are: ...finding the phone number of John Smith ...deleting all information about an employee with an ID # 4432 dbtien Data structures Table ADTs When you think of an ADT table, think of a table of major cities in the world including the city/country/population, a table of To-Do-List items, or a table of addresses including names/addresses/phone number/birthday. Each entry in the table contains several pieces of information. It is designed to allow you to look up information by various search keys dbtien Data structures Table ADTs The basic operations that define an ADT Table are: (notice, various search keys!!) Create an empty table (e.g., Create(Table)) Insert an item into the table (e.g., Insert(Table,Newdata)) Delete an item from the table (e.g., Delete(Table, Key)) Retrieve an item from the table (e.g., Retrieve(Table, Key, Returneddata)) dbtien Data structures Table ADTs But, just like before, you should realize that these operations are only one possible set of table operations. Your application might require either a subset of these operations or other operations not listed here. Or, it might be better to modify the definitions...to allow for duplicate items in a table. dbtien Data structures Table ADTs Does anyone see a problem with this approach so far?...
View Full Document

Page1 / 60

CS163_Week4_topic2 - CS163: Data structures Week 4 topic 2:...

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

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