


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 19: Data Structures and Algorithms Submission date 03/11/2003 Date Received 1st submission 03/11/ Re-submission Date Date Received 2nd submission Student Name Nguyễn Văn Trường Student ID GCH Class GCH1107 Assessor name Đỗ Hồng Quân Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid P 4 P 5 P 6 P 7 M 4 M 5 D3 D
Summative Feedback: Resubmission Feedback: Grade: Assessor Signature: Date: Internal Verifier’s Comments: IV Signature:
1.1. define A stack is a linear data structure that operates based on the Last-In, First-Out (LIFO) mechanism, and it is one of the fundamental abstract data structures. It follows a fixed sequence of operations, which means that the order of operations can be either LIFO (Last In, First Out) or FILO (First In, Last Out). To illustrate, think of a stack of plates, where the last plate added will be the first one to be removed. This enables you to access the most recently added item in the stack immediately, just like grabbing the top plate from the stack of plates in one go. (GeeksforGeeks 2023) 1.2. Operations
The node structure of a stack in a singly linked list includes two main components: Data: This is the part of the node where you store the specific value you want to put on the stack. Next Pointer: This is a pointer or reference to the next node in the stack. In a singly linked list, each node only knows about the next node in the list.
2. Doubly Linked List ADT 2.1. Define A doubly linked list is a more intricate variation of a linked list, where each node includes references to both the previous and the next nodes in the sequence. Consequently, a node in a doubly linked list comprises three components: node data, a pointer to the following node in the sequence (referred to as the "next" pointer), and a pointer to the previous node (known as the "previous" pointer). (javatpoint, 2023) 2.2. Operations
add((int data, int index) adds a new element at a specific position in the list using the index. add cource code add operation
Search(int data) is used to look up the last occurrence of a particular value and return that value's position, from the tail of the stack. Search source code Search operation