نام فایل : ساختمان داده (2)
فرمت : .ppt
تعداد صفحه/اسلاید : 123
حجم : 1641 کیلوبایت
CH4. LINKED LISTS
4.1 Singly Linked Lists
Sequential representation
successive nodes of the data object are stored a fixed distance apart
order of elements is the same as in ordered list
adequate for functions such as accessing an arbitrary node in a table
operations such as insertion and deletion of arbitrary elements from ordered lists become expensive
Linked representation
successive items of a list may be placed anywhere in memory
order of elements need not be the same as order in list
each data item is associated with a pointer (link) to the next item
4.1 Singly Linked Lists(Cont’)
List of 3-letter words : (BAT, CAT, EAT, ..., VAT, WAT)
Figure 4.1: Nonsequential list representation
data[8] = BAT
first = 8
link[8] = 3
data[3] = CAT
4.1 Singly Linked Lists(Cont’)
BAT
CAT
....
مبلغ قابل پرداخت 49,000 تومان