Get current working directory



Download 0,84 Mb.
bet5/21
Sana21.04.2022
Hajmi0,84 Mb.
#569000
1   2   3   4   5   6   7   8   9   ...   21
Bog'liq
notes2

Indirect Applications


  • Auxiliary data structure for algorithms

  • Component of other data structures

Linked-list
In this article, we will quickly look into what is linked list?, comparison with Arrays, advantage and disadvantages over Arrays and types of linked lists.

What is a Linked List?


A linked list is a data structure used for storing collections of data. A linked list has the following properties.

  • Successive elements are connected by pointers

  • The last element points to NULL

  • Can grow or shrink in size during execution of a program

  • Can be made just as long as required (until systems memory exhausts)

  • Does not waste memory space (but takes some extra memory for pointers). It allocates memory as the list grows.

Linked List Representation


A linked list can be visualized as a chain of nodes, where every node points to the next node.


  • Linked List contains a link element called first.

  • Each link carries a data field(s) and a link field called next.

  • Each link is linked with its next link using its next link.

  • The last link carries a link as null to mark the end of the list.

Difference Between Linked lists and Arrays


As we know that both linked lists and Arrays are used to store collections of data, and since both are used for the same purpose, we need to differentiate their usage. That means in which cases arrays are suitable and in which cases linked lists are suitable.
Let's first briefly look at advantage and disadvantage of Arrays then we will compare Arrays with Linked lists.

Array Overview


  • An array is a container object that holds a fixed number of values of a single type.

  • The length of an array is established when the array is created. After creation, its length is fixed.

  • As we know Array is a data structure where we store similar elements and Array starts from index 0.

  • Each item in an array is called an element, and each element is accessed by its numerical index.

  • Since arrays are objects in Java, we can find their length using member length.

  • A Java array variable can also be declared like other variables with [] after the data type.

  • The variables in the array are ordered and each has an index beginning from 0.

  • Java array can be also be used as a static field, a local variable or a method parameter.

  • The size of an array must be specified by an int value and not long or short.



Download 0,84 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   21




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