Indonesian Journal on Computing (Indo-JC)
Vol. 5 No. 3 (2020): December, 2020

Hybrid Array List: An Efficient Dynamic Array with Linked List Structure

Mutaz Rasmi Abu Sara (Taibah University)
Mohammad F. J. Klaib (Taibah University)
Masud Hasan (Taibah University)



Article Info

Publish Date
09 Jan 2021

Abstract

In this paper, we present an efficient dynamic array, called hybrid array list (HAL), whose structure is a linked list and each node is an array. In a HAL H, each node, called a chunk, is an array of size at most 2c, where c is an initial array size determined by the user. As the elements are added or deleted in H, it grows or shrinks by the number of nodes in the linked list as well as by the sizes of the chunks. We consider the operations append, insert and delete as well as a helping operation actual position in H. These operations run in O(1), O(m+c), O(m+c) and O(m) time, respectively, in worst case, where m is the number of chunks in H. These running times are much less than the worst case running time, which is O(n), where n is the total number of elements in H, taken by these operations in linked list or array. We implement HAL and compare these operations with similar operations in array list of Java and vector of C++. Our results show that H can perform substantially better when c is about half of the total number of elements.

Copyrights © 2020






Journal Info

Abbrev

indojc

Publisher

Subject

Computer Science & IT

Description

Indonesian Journal on Computing (Indo-JC) is an open access scientific journal intended to bring together researchers and practitioners dealing with the general field of computing. Indo-JC is published by School of Computing, Telkom University ...