m.lev-yashin-1st-klub-union-dynamo-balon-1963-fc-s8.prestasi.web.id Layanan Informasi 17 Jam
Telp/Fax : 021-8762002, 8762003, 8762004, 87912360
HP/SMS : 081 1110 4824 27, 0812 9526 2009, 08523 1234 000
WhatsApp : 0817 0816 486, 0812 9526 2009
email : _Hubungi Kami__ silahkan klik
Chatting dengan Staf :
ggkarir.com
ggiklan.com
Pilih Bahasa :   ID   EN   Permintaan Katalog / Brosur (GRATIS via POS)   Ensiklopedia Lowongan Kerja Iklan

   
Cari  
    Telekomunikasi Sains

    Sebelumnya  (Selenium) (Self-hosting)  Berikutnya    

Self-balancing binary search tree

An example of an unbalanced tree
The same tree after being height-balanced

In computer science, a self-balancing (or height-balanced) binary search tree is any node-based binary search tree that automatically keeps its height (number of levels below the root) small in the face of arbitrary item insertions and deletions.[1]

These structures provide efficient implementations for mutable ordered lists, and can be used for other abstract data structures such as associative arrays, priority queues and sets.

Contents

Overview

Tree rotations are very common internal operations on self-balancing binary trees to keep perfect or near-to-perfect balance.

Most operations on a binary search tree (BST) take time directly proportional to the height of the tree, so it is desirable to keep the height small. A binary tree with height h can contain at most 20+21+···+2h = 2h+1−1 nodes. It follows that for a tree with n nodes and height h:

n\le2^{h+1}-1

And that implies:

h\ge\lceil\log_2(n+1)-1\rceil\ge \lfloor\log_2 n\rfloor.

In other words, the minimum height of a tree with n nodes is log2(n), rounded down; that is,  \lfloor \log_2 n\rfloor:.[1]

However, the simplest algorithms for BST item insertion may yield a tree with height n in rather common situations. For example, when the items are inserted in sorted key order, the tree degenerates into a linked list with n nodes. The difference in performance between the two situations may be enormous: for n = 1,000,000, for example, the minimum height is  \lfloor \log_2(n) \rfloor = 19 .

If the data items are known ahead of time, the height can be kept small, in the average sense, by adding values in a random order, resulting in a random binary search tree. However, there are many situations (such as online algorithms) where this randomization is not viable.

Self-balancing binary trees solve this problem by performing transformations on the tree (such as tree rotations) at key times, in order to keep the height proportional to log2(n). Although a certain overhead is involved, it may be justified in the long run by ensuring fast execution of later operations.

Maintaining the height always at its minimum value \lfloor \log_2(n) \rfloor is not always viable; it can be proven that any insertion algorithm which did so would have an excessive overhead.[citation needed] Therefore, most self-balanced BST algorithms keep the height within a constant factor of this lower bound.

In the asymptotic ("Big-O") sense, a self-balancing BST structure containing n items allows the lookup, insertion, and removal of an item in O(log n) worst-case time, and ordered enumeration of all items in O(n) time. For some implementations these are per-operation time bounds, while for others they are amortized bounds over a sequence of operations. These times are asymptotically optimal among all data structures that manipulate the key only through comparisons.

Implementations

Popular data structures implementing this type of tree include:

Applications

Self-balancing binary search trees can be used in a natural way to construct and maintain ordered lists, such as priority queues. They can also be used for associative arrays; key-value pairs are simply inserted with an ordering based on the key alone. In this capacity, self-balancing BSTs have a number of advantages and disadvantages over their main competitor, hash tables. One advantage of self-balancing BSTs is that they allow fast (indeed, asymptotically optimal) enumeration of the items in key order, which hash tables do not provide. One disadvantage is that their lookup algorithms get more complicated when there may be multiple items with the same key. Self-balancing BSTs have better worst-case lookup performance than hash tables (O(log n) compared to O(n)), but have worse average-case performance (O(log n) compared to O(1)).

Self-balancing BSTs can be used to implement any algorithm that requires mutable ordered lists, to achieve optimal worst-case asymptotic performance. For example, if binary tree sort is implemented with a self-balanced BST, we have a very simple-to-describe yet asymptotically optimal O(n log n) sorting algorithm. Similarly, many algorithms in computational geometry exploit variations on self-balancing BSTs to solve problems such as the line segment intersection problem and the point location problem efficiently. (For average-case performance, however, self-balanced BSTs may be less efficient than other solutions. Binary tree sort, in particular, is likely to be slower than merge sort, quicksort, or heapsort, because of the tree-balancing overhead as well as cache access patterns.)

Self-balancing BSTs are flexible data structures, in that it's easy to extend them to efficiently record additional information or perform new operations. For example, one can record the number of nodes in each subtree having a certain property, allowing one to count the number of nodes in a certain key range with that property in O(log n) time. These extensions can be used, for example, to optimize database queries or other list-processing algorithms.

See also

References

  1. ^ a b Donald Knuth. The Art of Computer Programming, Volume 3: Sorting and Searching, Second Edition. Addison-Wesley, 1998. ISBN 0-201-89685-0. Section 6.2.3: Balanced Trees, pp.458–481.

External links

    Sebelumnya  (Selenium) (Self-hosting)  Berikutnya    


D3 Teknik ElektroS1 FarmasiTV & Radio AsingPeternakanKode POSBarter LinkGilland GroupSeniHTML 5HardwareDialog Politik



Tags: Self-balancing binary search tree, Telekomunikasi Sains, 2272, Self balancing binary search tree An example of an unbalanced tree The same tree after being height balanced In computer science a self balancing (or height balanced ) binary search tree is any node based binary search tree that automatically keeps its height (number of levels below the root) small in the face of arbitrary item insertions and deletions, [ ] These structures provide efficient im, Self-balancing binary search tree, Bahasa Indonesia, Contoh Instruksi, Tutorial, Referensi, Buku, Petunjuk m.lev yashin 1st klub union dynamo balon 1963 fc s8, prestasi.web.id
 Tutorial Teknik Komputer    Program Kuliah Hybrid di 112 PTS Terbaik    Jadwal Sholat    Platform Try Out Online    Download Brosur    Kesempatan Karir    Kuliah Bebas Biaya

 Pusat Ilmu Bebas    Soal-Jawab Tes Potensi Akademik    Al-Qur'an Online    Program Kuliah Shift    Perkuliahan Reguler    Program Pascasarjana (Magister, S2)    Perkuliahan Eksekutif    Semua Iklan    Pendaftaran Online    Permintaan Beasiswa Kuliah    Semua Perdebatan
PERMINTAAN KATALOG
(GRATIS via POS)
Nama Penerima Katalog

Alamat Lengkap

Kota + Provinsi

Kode Pos

Email (tidak wajib)

⛦ harus diisi lengkap & jelas
Atau kirimkan nama dan
alamat lengkap via SMS ke HP:
0811 1990 9026


Brosur Gratis
Brosur Kelas Karyawan
Gabungan Seluruh Wilayah Indonesia

pdf (11,2 MB)zip (8,8 MB)
Image/JPG (36,2 MB)
Brosur Kelas Karyawan
JABODETABEK

pdf (5,5 MB)zip (4,4 MB)
Image/JPG (13,2 MB)
Brosur Kelas Karyawan
DIY,JATENG,JATIM & BALI

pdf (4,4 MB)zip (3,5 MB)
Image/JPG (14,5 MB)
Brosur Kelas Karyawan
JAWA BARAT

pdf (2,8 MB)zip (2,2 MB)
Image/JPG (7,1 MB)
Brosur Kelas Karyawan
SULAWESI

pdf (1,9 MB)zip (1,5 MB)
Image/JPG (5,6 MB)
Brosur Kelas Karyawan
SUMATERA & BATAM

pdf (2,2 MB)zip (1,7 MB)
Image/JPG (6,5 MB)
Brosur Reguler
pdf (4,1 Mb)zip (8,4 Mb)
Kalender RI 2023
Image/JPG (2,1 Mb)pdf (400 kb)
Soal UN & SBMPTN
pdf(3,5 Mb)zip(1,5 Mb)
STRATEGI MENINGKATKAN
Pendapatan, Kualitas Pendidikan dan Sumber Daya PTS

pdf(6 Mb)Image/JPG(16 Mb)

Terobosan Baru
Strategi MENINGKATKAN
Kualitas Pendidikan, Sumber Daya dan Pendapatan PTS
Ikhtisar Terperinci
silakan klik di bawah ini
http://kpt.co.id

Lowongan Kerja

PT. Gilland Ganesha

Dibutuhkan Segera
  • Design Grafis
  • Tenaga Ahli Pemrograman

Rangkuman Menyeluruh di :
Kesempatan kerja

155 Jenis / Ras Kucing

Pengetahuan dasar kucing, arti warna kucing, jadwal vaksinasi kucing, dsb.

Facebook Kuliah Karyawan
Twitter Kuliah Karyawan

Tautan Khusus
Pendidikan
PTS Terbaik & Terpandang
Perkuliahan Program S1, S2, D3

Manfaat Nangka

Merawat tumbuhan Savory, Kandungan zat gizi Sorrel, Menanam benih / biji Kacang Gude di sekitar rumah, dsb.

Tujuan Penting
silakan klik di bawah ini
Semua Literatur Dunia

alkamal-jakarta.sch.id  |  ypp-alkamal-jakarta.or.id  |  ypp-alkamal-jakarta.org  |  ypp-alkamal-jakarta.com  |  alkamal-jakarta.org  |  download-soalujian.com  |  soal-ujian.com  |  ibm-bekasi.web.id  |  bina-tunggal.web.id  |  sebi.web.id  |  s2-uwks.web.id