Assignment LL Foronda
Assignment LL Foronda
BSCS – 2A
Assignment
1. What is Linked List?
A linked list is a type of linear data structure in which the members (elements) are not
stored in consecutive memory regions. Whereas a linked list consists of nodes which
contains a data field and a reference(link) to the next node in the list. A linked list's
elements are linked via pointers, just as showed in the diagram below:
HEAD NULL
While, Doubly Linked List is a type of data structure that also contains data and
reference(link) to the next node but it can go to the previous node in the sequence.
Unlike the Singly Linked List, this allows a two-way traversal which means that
navigation is made easier because it can traverse the list in both directions not only in
the front.
3. Illustrate a singly LL
start
4. Illustrate a doubly LL
start
null
5. Enumerate & describe the operations in LL
o Traversal: to traverse all the nodes one after another.
o Example:
void traverseLL(Node head) {
while(head != NULL)
{
print(head.data)
head = head.next
}
}
Hatim. (2023). What is the difference between a singly and a doubly linked list? TutorChase.
https://www.tutorchase.com/answers/a-level/computer-science/what-is-the-difference-
between-a-singly-and-a-doubly-linked-list (Question 2)
https://www.geeksforgeeks.org/data-structures/linked-list/ (Question 1)
S, R. A. (2021, May 17). Linked list in a data structure: All you need to know | Simplilearn.
Simplilearn.com. https://www.simplilearn.com/tutorials/data-structure-tutorial/linked-
Types of linked list and operation on linked list. (n.d.). AfterAcademy | Platform for learning
and-operation-on-linked-list/ (Question 5)