Binary Search Trees



Download 469,5 Kb.
bet1/2
Sana23.06.2022
Hajmi469,5 Kb.
#696694
  1   2
Bog'liq
rfdhdh

Binary Search Trees

  • One of the tree applications in Chapter 10 is binary search trees.
  • In Chapter 10, binary search trees are used to implement bags and sets.
  • This presentation illustrates how another data type called a dictionary is implemented with binary search trees.

The Dictionary Data Type

  • A dictionary is a collection of items, similar to a bag.
  • But unlike a bag, each item has a string attached to it, called the item's key.

The Dictionary Data Type

  • A dictionary is a collection of items, similar to a bag.
  • But unlike a bag, each item has a string attached to it, called the item's key.
  • Example:
  • The items I am
  • storing are records
  • containing data
  • about a state.

The Dictionary Data Type

  • A dictionary is a collection of items, similar to a bag.
  • But unlike a bag, each item has a string attached to it, called the item's key.
  • Example:
  • The key for each
  • record is the name
  • of the state.
  • Washington

The Dictionary Data Type

  • The insertion procedure for a dictionary has two parameters.
  • void dictionary::insert(The key for the new item, The new item);
  • Washington

The Dictionary Data Type

  • When you want to retrieve an item, you specify the key...
  • Item dictionary::retrieve("Washington");

The Dictionary Data Type

  • Item dictionary::retrieve("Washington");
  • When you want to retrieve an item, you specify the key... ... and the retrieval procedure returns the item.

The Dictionary Data Type

  • We'll look at how a binary tree can be used as the internal storage mechanism for the dictionary.

Download 469,5 Kb.

Do'stlaringiz bilan baham:
  1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish