m.kelas-karyawan-ftumj.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)   Kelas Karyawan   Reguler
S1 Teknologi PanganS1 Ilmu Administrasi Bisnis / NiagaS1 Ilmu Administrasi Publik / NegaraS1 Ilmu HukumS1 Ilmu Kesejahteraan SosialS1 Ilmu KomunikasiS1 Ilmu PertanianPolitikFilsafatAntIlmu KomputerDebat TeknikIslam

   
Cari  
    Komputer Sains

    Sebelumnya  (RootkitRevealer) (Rosario, Santa Fe)  Berikutnya    

Rope (data structure)

A simple rope built on the string of "Hello_my_name_is_Simon".

In computer programming a rope, or cord, is a data structure for efficiently storing and manipulating a very long string. For example, a text editing program may use a rope to represent the text being edited, so that operations such as insertion, deletion, and random access can be done efficiently.[1]

Contents

Description

A rope is a binary tree. Leaf nodes (as well as some single-child internal nodes) contain a short string. Each node has a "weight" equal to the length of its string plus the sum of all the weights in its left subtree. Thus a node with two children divides the whole string into two parts: the left subtree stores the first part of the string. The right subtree stores the second part and its weight is the sum of the left child's weight and the length of its contained string.

The binary tree can be seen as several levels of nodes. The bottom level contains all the nodes that contain a string. Higher levels have fewer and fewer nodes. The top level consists of a single "root" node. The rope is built by putting the nodes with short strings in the bottom level, then attaching a random half of the nodes to parent nodes in the next level. Nodes with no parent (for example, the two nodes storing the strings "my_" and "me_i" in the diagram above) become the right child of the node located immediately to their left, thus forming a chain.

Operations

Index

Definition: Index(i): return the character at position i
Time complexity: O(log N) where N is the length of the rope

To retrieve the i-th character, we begin a recursive search from the root node:

// Note: Assumes 1-based indexing.function index(RopeNode node, integer i)    if node.weight < i then        return index(node.right, i - node.weight)    else        if exists(node.left) then            return index(node.left, i)        else            return node.string[i]        endif    endifend

For example, to find the character at i=10 in the following rope, start at the root node, find that 22 is greater than 10 and there is a left child, so go to the left child. 9 is less than 10, so subtract 9 from 10 (leaving i=1) and go to the right child. Then because 7 is greater than 1 and there's a left child, go to the left child. 6 is greater than 1 and there's a left child, so go to the left child again. Finally 2 is greater than 1 but there is no left child, so the character at index 1 of the short string "na", is the answer.

Search rope.jpg

Split

Definition: Split (i, S): split the string S into two new strings S1 and S2, S1 = C1, …, Ci and S2 = Ci + 1, …, Cm.
Time complexity: O(log N)

There are two cases: in the first, the i-th character is at the end of an array such as in the following picture; in the second, the character is in the middle of an array. The second case reduces to the first case as follows: split the node at the character into two nodes each with part of the array and make the second node the right child of the first node.

For example, to split the pictured rope into two parts, query the i-th character to locate the node v at the bottom level. Remove the link between v and the right child of v, or v’. Go to the parent u and subtract the weight of v’ from the weight of u. Since the parent has the right child of u, now u’, modify u’ to link to v’ and increase the weight of u’ by the weight of v’. The former left child of u’ becomes the right child of v’, creating the second picture. Continue up to the parent of u, w. Subtract the weight of v’ from the weight of w. Then modify the right child of w, now w’, to link to u’. The former child of w’ becomes the right child of u’. Increase the weight of w’ by the weight of v’. Move to the parent of w, x. Since w is already the right child of x, there is no change. Then go to the parent of x, y, and reduce the weight of y by the weight of w’.

original
step1
step2

Concat

Definition: Concat(S1, S2): concatenate two ropes S1, S2 into a single rope.
Time complexity: O(log N)

This operation is the reverse of split, and requires O(log N) time on average to produce a rope with a balanced tree. (If one drops the constraint that the output tree should be balanced, a concatenation can be performed simply by creating a new root node with left=S1 and right=S2, which is constant time. Complexity estimates of other operations do however require ropes with balanced trees as input.)

Note also that this is a destructive concatenation, in that the input ropes S1 and S2 no longer exist after the operation is performed. When comparing with array concatenation, one should keep in mind that the latter is usually a non-destructive operation.

Insert

Definition: Insert(i, S’): insert the string S’ beginning at position i in the string s, to form a new string C1, …, Ci, S’, Ci + 1, …, Cm.
Time complexity: O(log N).

This operation can be done by a split() and a concat(). The cost is the sum of the two.

Delete

Definition: Delete(i, j): delete the substring Ci, …, Ci + j − 1, from s to form a new string C1, …, Ci − 1, Ci + j, …, Cm.
Time complexity: O(log N).

This operation can be done by two split() and a concat(). First, split the rope in three, divided by i-th and j-th character respectively, putting the string to delete in a separate node. Then concatenate the other two nodes.

Report

Definition: Report(i, j): output the string Ci, …, Ci + j − 1.
Time complexity: O(j + log N)

To report the string Ci, …, Ci + j − 1, find the node u that contains ci and weight(u) >= j, and then traverse T starting at node u. Output Ci, …, Ci + j − 1 by doing an in-order traversal of T starting at node u.

Comparison with monolithic arrays

Advantages:

  • Ropes enable much faster insertion and deletion of text than monolithic string arrays, on which operations have time complexity O(n).
  • Ropes don't require O(n) extra memory when operated upon (arrays need that for copying operations)
  • Ropes don't require large contiguous memory spaces.

Disadvantages:

  • Greater overall space usage when not being operated on, mainly to store parent nodes. There is a trade-off between how much of the total memory is such overhead and how long pieces of data are being processed as strings; note that the strings in example figures above are unrealistically short for modern architectures. The overhead is always O(n), but the constant can be made arbitrarily small.
  • Increase in time to manage the extra storage
  • Increased complexity of source code; greater risk for bugs

This table compares the algorithmic characteristics of string and rope implementations, not their "raw speed". Array-based strings have smaller overhead, so (for example) concatenation and split operations are faster on small datasets. However, when array-based strings are used for longer strings, time complexity and memory usage for insertion and deletion of characters become unacceptably large. A rope data structure, on the other hand, has stable performance regardless of data size. Moreover, the space complexity for ropes and arrays are both O(n). In summary, ropes are better suited when the data is large and frequently modified.

Performance
OperationRopeString
Index[1]O(log n)O(1)
Split[1]O(log n)O(1)
Concatenate (destructive)O(log n)O(n)
Concatenate (nondestructive)O(n)O(n)
Iterate over each character[1]O(n)O(n)
InsertO(log n)O(n)
AppendO(log n)O(1) amortized, O(n) worst case
DeleteO(log n)O(n)
ReportO(j + log n)O(j)
BuildO(n)O(n)

[citation needed]

See also

  • The Cedar programming environment, which used ropes "almost since its inception"[1]
  • The Model T enfilade, a similar data structure from the early 1970s.
  • Gap buffer, a data structure commonly used in text editors that allows efficient insertion and deletion operations clustered near the same location

References

  1. ^ a b c d e Boehm, Hans-J; Atkinson, Russ; and Plass, Michael (December 1995). "Ropes: an Alternative to Strings" (PDF). Software—Practice & Experience (New York, NY, USA: John Wiley & Sons, Inc.) 25 (12): 1315–1330. doi:10.1002/spe.4380251203. 

External links

    Sebelumnya  (RootkitRevealer) (Rosario, Santa Fe)  Berikutnya    





Tags: Rope (data structure), Komputer Sains, 2243, Rope (data structure) A simple rope built on the string of, Hello_my_name_is_Simon, In computer programming a rope or cord is a data structure for efficiently storing and manipulating a very long string, For example a text editing program may use a rope to represent the text being edited so that operations such as insertion deletion and random access can be done efficiently, [ ] Con, Rope (data structure), Bahasa Indonesia, Contoh Instruksi, Tutorial, Referensi, Buku, Petunjuk m.kelas karyawan ftumj, prestasi.web.id
 Download Brosur    Bursa Karir    Berbagai Perdebatan    Program S2 (Pascasarjana)
Kuliah Reguler Pagi (Hybrid)

Koleksi Jenis Foto
Penerimaan Mahasiswa/i
Program Studi
Layanan + Download

Pustaka Khusus
Kumpulan Web Kuliah Karyawan
Kumpulan Web Perkuliahan Paralel
Kumpulan Web Gabungan PTS
Kumpulan Web Program Reguler Pagi/Siang
Kumpulan Web Program S2 (Pascasarjana)

 Berbagai Publikasi    Pendaftaran Online    Pengajuan Beasiswa    Kuliah Hybrid di 112 PTS Terbaik    Program Perkuliahan Gratis    Program Kuliah Extension    Program Kuliah Reguler Pagi/Siang    Perkuliahan Paralel    Try Out Online Gratis    Jadwal Sholat    Qur'an Online    Buku Tutorial    Soal-Jawab Psikotes/TPA    Semua Literatur Bebas
Link Khusus ke
PTS Terakreditasi & Terkemuka
Penyelenggara Program S1, D3, S2

(silakan klik di bawah ini)
STMIKMJ - STMIKMJ Jakarta
IGI - STIE IGI Jakarta
STTM Cileungsi - STIE Cileungsi
STIE WP - STIE Widya Persada
UPRI - UPRI Makassar
STEI - STEI Yogyakarta
STIE - Hidayatullah Depok
STEBI - Bina Essa
P2KKMPoliteknik Aisyiyah

P2KKMUMPTB Lampung
P2KKMSTIT Al-Hikmah Lampung

P2KKMUniv.Amir Hamzah
P2KKMUSM Indonesia
P2KKMUniv. Al-Azhar Medan
P2KKMUniversitas Deli Sumatera

P2KKMUniv. Muh. Palangkaraya

P2KKMSTIT Nur Ahadiyah

P2KKMUniv. Nahd. Ulama Kalbar

P2KKMUniv. Nahd. Ulama Kaltim

Langsa -- Aceh :
P2KKMUSCND Langsa

P2KKMUniv. Ubudiyah Indonesia

P2KKMSTIT Hidayatullah
P2KKMIAI Abdullah Said

P2KKMUniv. Pejuang Rep. Ind.
P2KKMUniv. Teknologi Sulawesi
P2KKMUniv. Cokroaminoto Makassar
P2KKMITeKes Tri Tunas Nasional

P2KKMUniv. Patria Artha

P2KKMUniv. Nusantara, Manado
P2KKMSTIE Pioneer Manado
P2KKMUniversitas Parna Raya Manado

P2KKMUniversitas Boyolali

P2KKMUniversitas Duta Bangsa
P2KKMPoliteknik Harapan Bangsa Surakarta
P2KKMPoliteknik Santo Paulus Surakarta

P2KKMUNIBABWI

P2KKMUniv. Muhammadiyah Smrg
P2KKMUNDARIS Semarang
P2KKMUNAKI Semarang
P2KKMUPGRIS Semarang
P2KKMUniv. IVET Semarang
P2KKMSTIE Cendekia

P2KKMUNUGHA Cilacap

P2KKMUniv. Muhammadiyah Sby
P2KKMSTIE Pemuda Sby
P2KKMIKIP Widya Darma Sby
P2KKMSTIE Widya Darma Sby
P2KKMSTIE ABI Surabaya
P2KKMUNUSA Surabaya
P2KKMUniv. Widya Kartika
P2KKMSTAI Al Akbar Surabaya

P2KKMUniv. Kahuripan Kediri

P2KKMSTAI Muhammadiyah Tulungagung

P2KKMSTIKI Malang
P2KKMSTIE INDOCAKTI
P2KKMSTIE Al Rifa'ie

P2KKMSTIA Bayuangga
P2KKMSTAI Muhammadiyah Probolinggo

P2KKMUniversitas Moch. Sroedji

P2KKMSTEI JOGJA - STEI Yogyakarta
P2KKMSTIE Mitra Indonesia
P2KKMSTiPsi
P2KKMSTAI Terpadu Yogyakarta
P2KKMUniversitas Mahakarya Asia

P2KKMSTIE Hidayatullah
P2KKMSTIE - GICI A
P2KKMSTIE - GICI A


P2KKMSTMIK-MJ - STMIK Muh. Jkt.
P2KKMUNKRIS - Krisnadwipayana
P2KKMSTT Bina Tunggal - Bekasi
P2KKMSTT Duta Bangsa - Bekasi
P2KKMSTIE - GICI C
P2KKMSTEBI Global Mulia
P2KKMUniversitas Pelita Bangsa
P2KKMUniversitas Indonesia Mandiri
P2KKMPoliteknik Bhakti Kartini

P2KKMSTMIK-STIKOM Bali
P2KKMPOLNAS Denpasar
P2KKMUniversitas Bali Dwipa
P2KKMPoltek Ganesha Guru Singaraja

P2KKMSTIE Ganesha
P2KKMSTT Yuppentek
P2KKMITB Ahmad Dahlan
P2KKMUniv. Tangerang Raya
P2KKMSTIA Maulana Yusuf
P2KKMSTIH Gunung Jati
P2KKMSTIE PPI Balaraja

P2KKMUNSUB - Universitas Subang

P2KKMSTIT Al-Hidayah Tasikmalaya

P2KKMSTIE Walisongo
P2KKMSTT Walisongo

P2KKMUniv. Islam Al-Ihya

P2KKMSTT Mandala, Bandung
P2KKMSTT Bandung
P2KKMSTIE Gema Widya Bangsa
P2KKMUniversitas Insan Cendekia Mandiri
P2KKMUniversitas Halim Sanusi
P2KKMUniversitas Persatuan Islam
P2KKMSTEBI Bina Essa

P2KKMSTT Dr. Khez Muttaqien

P2KKMIMWI Sukabumi

P2KKMSTIH Dharma Andigha
P2KKMUniversitas Teknologi Nusnatara

P2KKMSTT Muhammadiyah Cileungsi

P2KKMISTA - Institut ST Al Kamal
P2KKMSTIE IGI - Inter. Golden Inst.
P2KKM Univ. Mpu Tantular B

P2KKMU M J - Univ. Muh. Jkt

P2KKMFISIP UMJ - Univ. Muh. Jkt.
P2KKMFTan UMJ - Agroteknologi
P2KKMSTIE Trianandra Jakarta
P2KKMSTIE - GICI B
P2KKMSTIE Ganesha
P2KKMSTIMAIMMI Jakarta
P2KKMTanri Abeng University

P2KKMUMHT - Univ. MH. Thamrin
P2KKMFE UMHT - FE MH. Thamrin
P2KKMFASILKOM UMHT
P2KKMUNKRIS - Krisnadwipayana
P2KKMITBU - Inst. Tek. Budi Utomo
P2KKMSTIE Trianandra Jakarta
P2KKMSTMIK Muh. Jkt - Matraman
P2KKMSTMIK Muh. Jkt - Ciracas
P2KKMUniv. Mpu Tantular A
P2KKMSTT Sapta Taruna
P2KKMIAI Al-Ghurabaa Jakarta

P2KKMISIF - Institut Studi Islam Fahmina

P2KKMSTEBI Global Mulia

P2KKMSTIKes Sapta Bakti
P2KKMSTAI Miftahul ulum

P2KKMPoltekkes Kerta Cendekia

P2KKMPelita Raya Institute


KPT Konsultan Pendidikan Tinggi

PERMINTAAN BROSUR
(Gratis via POS)
Nama Penerima

Alamat Jelas

Kota/Kabupaten + Provinsi

Kode Pos

Email (tidak wajib)

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


Download BROSUR
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 Kuliah Reguler
pdf (4,1 Mb)ZIP (8,4 Mb)
Strategi Meningkatkan
Kualitas Pendidikan, Pendapatan dan Sumber Daya PTS

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

STRATEGI Meningkatkan
Kualitas Pendidikan, Pendapatan dan Sumber Daya PTS
http://kpt.co.id
Terobosan Baru

PT. Gilland Ganesha
Membutuhkan Segera

  • Design Grafis
  • Web Programmer

Penjelasan Lebih Lanjut di :
Info kerja

Persalinan kucing dan persiapannya, makanan kucing, dsb.
155 Ras Kucing di Dunia

Twitter Kuliah Karyawan

Tautan Elok
silakan klik
Ensiklopedia Online

1. MIA FISIP UMJ Jakarta - Magister Ilmu Administrasi Universitas Muhammadiyah Jakarta - Kampus FISIP - UMJ : Jl. KH. Ahmad Dahlan, Cirendeu, Ciputat, Jakarta Selatan 15419
2. MIKOM FISIP UMJ Jakarta - Magister Ilmu Komunikasi Universitas Muhammadiyah Jakarta - Kampus FISIP - UMJ : Jl. KH. Ahmad Dahlan, Cirendeu, Ciputat, Jakarta Selatan 15419
3. MM UNKRIS Jakarta - Magister Manajemen Universitas Krisnadwipayana Jakarta - Kampus UNKRIS : Jl. Raya Jatiwaringin, Pondok Gede, Jakarta Timur 13077
4. S2 FISIP UMJ Jakarta - Magister FISIP Universitas Muhammadiyah Jakarta - Kampus FISIP - UMJ : Jl. KH. Ahmad Dahlan, Cirendeu, Ciputat, Jakarta Selatan 15419
5. S2 UNKRIS Jakarta - Pascasarjana (S2, Magister) Universitas Krisnadwipayana Jakarta - Kampus UNKRIS : Jl. Raya Jatiwaringin, Pondok Gede, Jakarta Timur 13077
unisa.web.id  |  dharma-andigha.web.id  |  p2k.uks.ac.id  |  duniakicau.web.id  |  mmunkris.ac.id  |  p2k.cyber-univ.ac.id  |  unismu.web.id  |  p2k.sebi.ac.id  |  stiepasim.web.id  |  uyi.web.id  |  unmtangerang.web.id