Postingan

Menampilkan postingan dari Februari, 2018

Linked List

Gambar
Generally a Linked List means "Singly Linked List". It is a chain of records known as Nodes . Each node has at least two members, one of which points to the next Node in the list and the other holds the data. Figure 1: Singly Linked List Basically Single Linked Lists are uni-directional as they can only point to the next Node in the list but not to the previous. We use below structure for a Node in our example. struct Node { int Data; struct Node *Next; }; Variable Data holds the data in the Node (It can be a pointer variable pointing to the dynamically allocated memory) while Next holds the address to the next Node in the list. Figure 2: Node in a Singly Linked List Head is a pointer variable of type struct Node which acts as the Head to the list. Initially we set ' Head ' as NULL which means list is empty. Basic Operations on a Singly Linked List Traversing a List Inserting a Node in the List Deleting a Node from the List Travers...

Pointer, Array and Introduction to Data Structure-fernando-2101637812

Pointer, Array and Introduction to Data Structure •        Array Review •        Pointer Review •        Types of Data Structures •        Abstract Data Type 1. Array        Array adalah kumpulan elemen data yang sama, dimana data tersebut memiliki tipe data yang sama (homogen). Tipe data tersebut dapat berupa integer(angka), char(karakter), floating point (angka berkoma), long(angka yang memiliki kapasitas diatas integer - 2^32), dan double (angka berkoma yang memiliki kapasitas yang lebih besar dari floating point).         Array disimpan dalam memori yang statis, artinya alokasi memori dilakukan saat deklarasi sebuah array. Array sendiri dapat diakses lewat indexnya. Indexnya dimulai dari 0, bukan 1.         Array dapat berupa array 1-dimensi, array 2-dime...