The data structure called the “heap” is definitely not a disordered pi translation - The data structure called the “heap” is definitely not a disordered pi Indonesian how to say

The data structure called the “heap

The data structure called the “heap” is definitely not a disordered pile of items
as the word’s definition in a standard dictionary might suggest. Rather, it is a
clever, partially ordered data structure that is especially suitable for implementing
priority queues. Recall that a priority queue is a multiset of items with an orderable
characteristic called an item’s priority, with the following operations:

finding an item with the highest (i.e., largest) priority
deleting an item with the highest priority
adding a new item to the multiset
It is primarily an efficient implementation of these operations that makes
the heap both interesting and useful. Priority queues arise naturally in such applications as scheduling job executions by computer operating systems and traffic management by communication networks. They also arise in several important algorithms, e.g., Prim’s algorithm (Section 9.1), Dijkstra’s algorithm (Section 9.3), Huffman encoding (Section 9.4), and branch-and-bound applications
(Section 12.2). The heap is also the data structure that serves as a cornerstone of
a theoretically important sorting algorithm called heapsort. We discuss this algorithm after we define the heap and investigate its basic properties.

Notion of the Heap
DEFINITION A heap can be defined as a binary tree with keys assigned to its
nodes, one key per node, provided the following two conditions are met:
1. The shape property—the binary tree is essentially complete(or simply complete), i.e., all its levels are full except possibly the last level, where only some
rightmost leaves may be missing.
2. The parental dominance or heap property—the key in each node is greater
than or equal to the keys in its children. (This condition is considered automatically satisfied for all leaves.)5
For example, consider the trees of Figure 6.9. The first tree is a heap. The
second one is not a heap, because the tree’s shape property is violated. And the
third one is not a heap, because the parental dominance fails for the node with
key 5.
Note that key values in a heap are ordered top down; i.e., a sequence of values
on any path from the root to a leaf is decreasing (non increasing, if equal keys are
allowed). However, there is no left-to-right order in key values; i.e., there is no
relationship among key values for nodes either on the same level of the tree or,
more generally, in the left and right subtrees of the same node.
Here is a list of important properties of heaps, which are not difficult to prove
(check these properties for the heap of Figure 6.10, as an example).
1. There exists exactly one essentially complete binary tree with n nodes. Its
height is equal tolog
2n.
2. The root of a heap always contains its largest element.
3. A node of a heap considered with all its descendants is also a heap.
4. A heap can be implemented as an array by recording its elements in the top down, left-to-right fashion. It is convenient to store the heap’s elements in
positions 1 through n of such an array,leaving H[0] either unused or putting
there a sentinel whose value is greater than every element in the heap. In such
a representation,
a. the parental node keys will be in the first n/2positions of the array,
while the leaf keys will occupy the lastn/2positions;
b. the children of a key in the array’s parental position i (1≤i≤n/2)will
be in positions 2iand 2i+1, and, correspondingly, the parent of a key in
position i(2≤i≤n)will be in positioni/2.
Thus, we could also define a heap as an array H[1..n] in which every element
in position i in the first half of the array is greater than or equal to the elements
in positions 2i and 2i+1, i.e.,
H[i]≥max{H[2i],H[2i+1]} fori=1,...,n/2.
(Of course, if 2i+1>n, just H[i]≥H[2i] needs to be satisfied.) While the ideas
behind the majority of algorithms dealing with heaps are easier to understand if
we think of heaps as binary trees, their actual implementations are usually much
simpler and more efficient with arrays.
How can we construct a heap for a given list of keys? There are two principal
alternatives for doing this. The first is the bottom-up heap construction algorithm
illustrated in Figure 6.11. It initializes the essentially complete binary tree with n
nodes by placing keys in the order given and then “heapifies” the tree as follows.
Starting with the last parental node, the algorithm checks whether the parental
0/5000
From: -
To: -
Results (Indonesian) 1: [Copy]
Copied!
The data structure called the “heap” is definitely not a disordered pile of itemsas the word’s definition in a standard dictionary might suggest. Rather, it is aclever, partially ordered data structure that is especially suitable for implementingpriority queues. Recall that a priority queue is a multiset of items with an orderablecharacteristic called an item’s priority, with the following operations:finding an item with the highest (i.e., largest) prioritydeleting an item with the highest priorityadding a new item to the multisetIt is primarily an efficient implementation of these operations that makesthe heap both interesting and useful. Priority queues arise naturally in such applications as scheduling job executions by computer operating systems and traffic management by communication networks. They also arise in several important algorithms, e.g., Prim’s algorithm (Section 9.1), Dijkstra’s algorithm (Section 9.3), Huffman encoding (Section 9.4), and branch-and-bound applications(Section 12.2). The heap is also the data structure that serves as a cornerstone ofa theoretically important sorting algorithm called heapsort. We discuss this algorithm after we define the heap and investigate its basic properties.Notion of the HeapDEFINITION A heap can be defined as a binary tree with keys assigned to itsnodes, one key per node, provided the following two conditions are met:1. The shape property—the binary tree is essentially complete(or simply complete), i.e., all its levels are full except possibly the last level, where only somerightmost leaves may be missing.2. The parental dominance or heap property—the key in each node is greaterthan or equal to the keys in its children. (This condition is considered automatically satisfied for all leaves.)5For example, consider the trees of Figure 6.9. The first tree is a heap. Thesecond one is not a heap, because the tree’s shape property is violated. And thethird one is not a heap, because the parental dominance fails for the node withkey 5.Note that key values in a heap are ordered top down; i.e., a sequence of valueson any path from the root to a leaf is decreasing (non increasing, if equal keys areallowed). However, there is no left-to-right order in key values; i.e., there is norelationship among key values for nodes either on the same level of the tree or,more generally, in the left and right subtrees of the same node.Here is a list of important properties of heaps, which are not difficult to prove(check these properties for the heap of Figure 6.10, as an example).1. There exists exactly one essentially complete binary tree with n nodes. Itsheight is equal tolog2n.2. The root of a heap always contains its largest element.3. A node of a heap considered with all its descendants is also a heap.4. A heap can be implemented as an array by recording its elements in the top down, left-to-right fashion. It is convenient to store the heap’s elements inpositions 1 through n of such an array,leaving H[0] either unused or putting
there a sentinel whose value is greater than every element in the heap. In such
a representation,
a. the parental node keys will be in the first n/2positions of the array,
while the leaf keys will occupy the lastn/2positions;
b. the children of a key in the array’s parental position i (1≤i≤n/2)will
be in positions 2iand 2i+1, and, correspondingly, the parent of a key in
position i(2≤i≤n)will be in positioni/2.
Thus, we could also define a heap as an array H[1..n] in which every element
in position i in the first half of the array is greater than or equal to the elements
in positions 2i and 2i+1, i.e.,
H[i]≥max{H[2i],H[2i+1]} fori=1,...,n/2.
(Of course, if 2i+1>n, just H[i]≥H[2i] needs to be satisfied.) While the ideas
behind the majority of algorithms dealing with heaps are easier to understand if
we think of heaps as binary trees, their actual implementations are usually much
simpler and more efficient with arrays.
How can we construct a heap for a given list of keys? There are two principal
alternatives for doing this. The first is the bottom-up heap construction algorithm
illustrated in Figure 6.11. It initializes the essentially complete binary tree with n
nodes by placing keys in the order given and then “heapifies” the tree as follows.
Starting with the last parental node, the algorithm checks whether the parental
Being translated, please wait..
Results (Indonesian) 2:[Copy]
Copied!
Struktur data yang disebut "tumpukan" jelas bukan tumpukan teratur item
sebagai definisi kata dalam kamus standar mungkin menyarankan. Sebaliknya, itu adalah
pintar, struktur data sebagian memerintahkan yang sangat cocok untuk menerapkan
antrian prioritas. Ingat bahwa antrian prioritas adalah multiset item dengan orderable
karakteristik yang disebut prioritas item, dengan operasi berikut: menemukan item dengan tertinggi (yaitu, terbesar) prioritas menghapus item dengan prioritas tertinggi menambahkan item baru ke multiset yang Hal ini terutama implementasi yang efisien dari operasi ini yang membuat tumpukan menarik dan berguna. Antrian prioritas muncul secara alami dalam aplikasi seperti eksekusi pekerjaan penjadwalan oleh sistem operasi komputer dan manajemen lalu lintas dengan jaringan komunikasi. Mereka juga muncul dalam beberapa algoritma penting, misalnya, algoritma Prim (Bagian 9.1), algoritma Dijkstra (Bagian 9.3), Huffman encoding (Bagian 9.4), dan aplikasi cabang-dan-terikat (Bagian 12.2). Tumpukan juga struktur data yang berfungsi sebagai landasan algoritma sorting secara teoritis penting yang disebut heapsort. . Kami membahas algoritma ini setelah kita mendefinisikan tumpukan dan menyelidiki sifat dasar Notion dari Heap DEFINISI Sebuah tumpukan dapat didefinisikan sebagai pohon biner dengan kunci ditugaskan untuk yang node, salah satu kunci per node, disediakan dua kondisi berikut terpenuhi: 1 . Properti-bentuk pohon biner pada dasarnya selesai (atau hanya lengkap), yaitu, semua tingkatan yang penuh kecuali mungkin tingkat terakhir, di mana hanya beberapa daun paling kanan mungkin hilang. 2. The orangtua dominasi atau tumpukan properti-kunci di setiap node lebih besar dari atau sama dengan tombol pada anak-anak nya. (Kondisi ini dianggap otomatis puas untuk semua daun.) 5 Sebagai contoh, perhatikan pohon-pohon dari Gambar 6.9. Pohon pertama adalah tumpukan. The kedua adalah tidak tumpukan, karena properti bentuk pohon dilanggar. Dan yang ketiga adalah tidak tumpukan, karena dominasi orangtua gagal untuk node dengan kunci 5. Perhatikan bahwa nilai-nilai kunci dalam tumpukan yang diperintahkan top down; yaitu, urutan nilai-nilai pada setiap jalur dari akar ke daun menurun (non meningkat, jika kunci sama yang diperbolehkan). Namun, tidak ada urutan kiri ke kanan nilai kunci; yaitu, tidak ada hubungan antara nilai-nilai kunci untuk node baik pada tingkat yang sama dari pohon atau, lebih umum, di kiri dan kanan sub pohon dari simpul yang sama. Berikut adalah daftar sifat penting dari tumpukan, yang tidak sulit untuk membuktikan (periksa sifat ini untuk tumpukan Gambar 6.10, sebagai contoh). 1. Ada ada pohon biner tepat satu dasarnya lengkap dengan n simpul. Its tinggi sama dengan? Log 2n ?. 2. Akar tumpukan selalu mengandung unsur yang terbesar. 3. Sebuah simpul dari tumpukan dianggap dengan semua keturunannya juga tumpukan. 4. Sebuah tumpukan dapat diimplementasikan sebagai array dengan merekam elemen di atas ke bawah, kiri ke kanan fashion. Hal ini mudah untuk menyimpan elemen tumpukan dalam posisi 1 sampai n dari sebuah array, meninggalkan H [0] baik yang tidak terpakai atau menempatkan ada sentinel yang nilainya lebih besar dari setiap elemen dalam tumpukan. Dalam seperti representasi, a. tombol simpul orangtua akan di pertama n / 2 posisi dari array,?? sedangkan tombol daun akan menempati terakhir n / 2 posisi;?? b. anak-anak kunci di posisi orangtua array i (1≤i≤? n / 2?) akan berada di posisi 2iand 2i + 1, dan, dengan demikian, induk dari kunci di posisi i (2≤i≤n) akan berada dalam posisi? i / 2 ?. Jadi, kami juga bisa mendefinisikan tumpukan sebagai array H [1..n] di mana setiap elemen di posisi saya di babak pertama dari array lebih besar dari atau sama dengan unsur-unsur di posisi 2i dan 2i + 1, yaitu, H [i] ≥max {H [2i], H [2i + 1]} fori = 1, ...,? n / 2 ?. (Tentu saja, jika 2i + 1> n, hanya H [i] ≥H [2i] perlu puas.) Sementara ide-ide di balik sebagian besar algoritma berurusan dengan tumpukan yang lebih mudah untuk memahami jika kita berpikir tentang tumpukan pohon biner, implementasi aktual mereka biasanya jauh sederhana dan lebih efisien dengan array. Bagaimana kita bisa membangun tumpukan untuk daftar yang diberikan kunci? Ada dua pokok alternatif untuk melakukan hal ini. Yang pertama adalah algoritma konstruksi tumpukan bottom-up diilustrasikan pada Gambar 6.11. Ini menginisialisasi pohon biner dasarnya lengkap dengan n simpul dengan menempatkan tombol dalam urutan yang diberikan dan kemudian "heapifies" pohon sebagai berikut. Dimulai dengan simpul orangtua terakhir, cek apakah orangtua algoritma






















































Being translated, please wait..
 
Other languages
The translation tool support: Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bosnian, Bulgarian, Catalan, Cebuano, Chichewa, Chinese, Chinese Traditional, Corsican, Croatian, Czech, Danish, Detect language, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Frisian, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Korean, Kurdish (Kurmanji), Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Myanmar (Burmese), Nepali, Norwegian, Odia (Oriya), Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scots Gaelic, Serbian, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Tatar, Telugu, Thai, Turkish, Turkmen, Ukrainian, Urdu, Uyghur, Uzbek, Vietnamese, Welsh, Xhosa, Yiddish, Yoruba, Zulu, Language translation.

Copyright ©2025 I Love Translation. All reserved.

E-mail: