{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
    CS163: Data structures Week 4 – topic 2: “Table” abstract data type 6/2008
Image of page 1

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

View Full Document Right Arrow Icon
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!
Image of page 2
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.
Image of page 3

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

View Full Document Right Arrow Icon
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.
Image of page 4
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
Image of page 5

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

View Full Document Right Arrow Icon
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
Image of page 6
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))
Image of page 7

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

View Full Document Right Arrow Icon
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.
Image of page 8
dbtien – Data structures Table ADTs Does anyone see a problem with this approach so far?
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern