1. Trang chủ
  2. » Luận Văn - Báo Cáo

Information technology assignment 1 unit data structures and algorithms

31 1 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Information technology assignment 1 unit: data structures and algorithms
Tác giả Vu Phong Thai
Người hướng dẫn Phan Hoang Phu
Trường học BTEC FPT International College
Chuyên ngành Information Technology
Thể loại bài tập
Năm xuất bản 2023
Thành phố Da Nang
Định dạng
Số trang 31
Dung lượng 4,6 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Cấu trúc

  • 1.1 Abstract Data Type (ADT)... 7 (10)
  • 1.2 Linked 6 nh (0)
    • 1.2.1 IP.o¡iiie 0 (0)
      • 1.2.2.2 Doubly Linked 0 nh (13)
      • 1.2.2.3 Circular Linked List 00 (14)
    • 1.4.1 IP.o¡iiie 0 (0)
  • 2. Determine the operations of a memory stack and how it is used to implement function calls (22)
    • 2.1.1 Text ii... on ..................... 14 2.1.2 Initialized Data Segment (Data Segm€n[):............................- -- che 14 (0)
    • 2.2.4. Top command (or peek cormmandÌ): ...........................-- --- sen irưkt 16 (24)
  • CHAPTER 2 SPECIFY ABSTRACT DATA TYPES AND ALGORITHMS IN A FORMAL NOTATIO! 16 (9)
    • 2.1 Using an imperative definition, specify the abstract data type for a software stack. (P3) 16 (24)
    • 1.3. Why You Should Use Software StaCKS:........................ nen HH HH tre 20 (28)
  • CONCLUSION 00. cccccccccsc cnc cccnecneneenecnesnenecnenecneceenecneeenesiessssesnenecneceeneeneeenesiesisnesnenecneneeneenesenesneseeness 21 (29)
  • EVALUATION 55................................. 22 (30)

Nội dung

‘BTEC $ TABLE OF CONTENT TABLE OF CONTENT o...cccscssssssseessssssssesssssseneesssssneesesesssnsessesansvrsssesssiesssssssnneesesssnieeseassneesesesnnneesserensecess ii LIST OF TABLES AN

Abstract Data Type (ADT) 7

An abstract data type (ADT) is a fundamental concept in computer science and software engineering that outlines a high-level model for organizing and manipulating data ADTs are independent of specific programming languages or implementation details, offering a formal specification of both the data and the operations applicable to it.

- Example List ADT: add(item), remove(item), get(index), size(), isEmptyQ

- Example Stack ADT: push(item) popQ),topQ) ,is_empty(),sizeQ

- Example Queue ADT: enqueue(item), dequeue(), front(),is empty(),sizeQ)

A linked list is a dynamic data structure made up of nodes that are interconnected through links or pointers Each node holds data and a reference to the subsequent node, allowing for easy expansion and contraction of the list.

Advantages of a linked list over an array:

Dynamic resizing: You can easily add or remove elements in a linked list without having to reallocate memory, whereas arrays require copying and resizing data as needed

Performed Student: Vu Phong Thai

“BTEC ` siằ su (BIỂN cacooa ‘BT E Cc

Inserting and deleting elements in a linked list is generally faster than in an array, particularly when minimal elements need to be copied or moved.

No pre-allocation: There is no need to pre-allocate a fixed size This is useful if you don't know the size of the list in advance

Disadvantages of a linked list compared to an array:

Slow random access: Accessing elements at random positions in a linked list requires trav- ersing all elements from the beginning, while arrays allow random access with an access time

Requires more memory: A linked list requires more memory for pointers/reference links, while arrays only require contiguous memory for elements

Not suitable for storing large, frequently accessed data: In cases where random access or large data storage is required, arrays may be more efficient

A singly linked list is a data structure consisting of nodes linked together through pointers Each node contains data and a reference to the next node in the sequence Unlike doubly linked lists, nodes in a singly linked list only point to the subsequent element, making it a simpler structure for certain applications.

This article presents a Java program that illustrates the creation of a singly linked list, detailing the insertion of elements into the list and showcasing the output by displaying the elements on the screen.

Performed Student: Vu Phong Thai

Figure 3: code of Singly Linked List

The data in the given list are:

Performed Student: Vu Phong Thai

A doubly linked list is a data structure consisting of nodes that can reference both their previous and next nodes, enabling bidirectional navigation This allows users to traverse the list from the beginning to the end or vice versa, facilitating efficient data management and manipulation.

I will create a doubly linked list and add nodes to it We will then display our doubly linked list

Figure 6: code of Doubly Linked List

Performed Student: Vu Phong Thai

“BTEC ` atone wih IG xe SBT E Cc

The Node class is designed for use in a doubly linked list, featuring a data field to hold node information, a Next field to reference the subsequent node, and a Previous field to point to the preceding node.

The DoublyLinkedList class defines a doubly linked list structure, featuring a header field that points to the list's first node In its constructor, the DoublyLinkedList initializes the head to null, signifying that the list is empty at the outset.

A circular linked list is a variation of the standard linked list, consisting of nodes that contain two components: data and a pointer to the next node In this structure, the head points to the first node, while the tail connects back to the head, creating a circular formation Unlike a simple linked list, where the tail points to null, in a circular linked list, every node points to its subsequent node, forming a continuous loop.

Circular linked list in java pee | pc HH HH5 BH

Performed Student: Vu Phong Thai ĐỤC ;BTEC

Figure 9: code of Circular Linked Li:

Nodes of the circular linked list:

Performed Student: Vu Phong Thai

A stack is a data structure that operates on a last in, first out (LIFO) principle, meaning that the most recently added element is the first to be removed This structure is widely utilized for managing context and sequences effectively.

Push item push 1sFull -printin

Performed Student: Vu Phong Thal

The push function adds an element to the top of the stack (if it is not full)

The pop function removes the element and returns it to the top of the stack (if it is not empty)

The isEmpty function checks whether the stack is empty

The isFull function checks whether the stack is full (size limit reached)

The size function returns the number of elements currently on the stack (stack size) 1.4 Queue

A queue is a data structure that operates on a first-in, first-out (FIFO) principle, where the first element added is also the first one to be removed This structure is commonly utilized to manage items in various contexts, such as service desk backlogs or tasks within cloud systems.

Below are the names of the basic functions you may see in the Queue class:

Enqueue(item): Adds an item to the end of the queue

Dequeue(): Deletes the element and returns it to the top of the queue

IsEmpty(): Checks whether the queue is empty

Size(): Returns the number of items currently in the queue

1.4.2.1 Single queue: front rear deletion — _ => _ => insertion

A single queue, known as a linked queue, operates on a first-in-first-out (FIFO) principle, ensuring that the first item added to the queue is the first one to be processed.

Performed Student: Vu Phong Thai

Figure 13: code of Single queue

Figure 14: Result code 1.4.2.2 Circular queue:

A circular queue, or ring queue, is a modified version of a traditional queue that allows items added to its end to wrap around and re-enter the beginning of the queue when needed.

Performed Student: Vu Phong Thai 10

Figure 16: code of Circular queue

Performed Student: Vu Phong Thai

A priority queue is a specialized data structure where each element is assigned a specific priority, allowing elements with higher priorities to be processed before those with lower priorities The focus is on the priority level of each element rather than their overall ranking.

Figure 19: Code of Priority Queue

Performed Student: Vu Phong Thai 12

1.4.2.4 Double-Ended Queue - Deque: insertion insertion deletion deletion

Figure 21: Double-Ended Queue - Deque

A double-ended queue, or deque, is a versatile data structure that enables the addition and removal of elements from both ends It combines the functionalities of a queue and a doubly linked list, making it a powerful tool for various applications.

Figure 23: code of Double-Ended Queue- Deque

Performed Student: Vu Phong Thai 13

2 Determine the operations of a memory stack and how it is used to implement function calls in a computer (P2)

Higher Address Command Line Arguments

Text/Code Segment | Lower Address

Memory Layout Figure 24: Memory layout 2.1.1 Text segment (code segment):

Purpose: Location containing the program's machine code, including instructions that exe- cute the program's functions, procedures and logic

- Typically a read-only memory area

- Contains executable code and constants

- The contents of this memory area cannot be changed during program execution

- Shared between multiple processes (if any) to save resources

2.1.2 Initialized Data Segment (Data Segment):

Purpose: Is a place to store global and static variables that are initialized with specific values

Performed Student: Vu Phong Thai 14

- Contains static data (for example: global variables, static variables)

- The data here is initialized before the program begins to execute

- Here data can be read and written during program execution

2.1.3 Uninitialized data segment (BSS - block starting with symbol):

Target: Contains global and static variables that are not initialized to default values (e.g global variables of type int has the default value 0)

-Does not store specific data, only default values

-Here data can be read and written, even while the program is running

-Commonly used to save memory resources when not all global variables need to be initial- ized

Purpose: Used for dynamic memory management and memory allocation for dynamic ob- jects and data

- Contains dynamic data assigned and shared by the programmer

- Heap size is not limited and depends on system memory management

- Developers need to worry about dynamic memory allocation and deallocation to avoid memory leaks

Linked 6 nh

Determine the operations of a memory stack and how it is used to implement function calls

SPECIFY ABSTRACT DATA TYPES AND ALGORITHMS IN A FORMAL NOTATIO! 16

Using an imperative definition, specify the abstract data type for a software stack (P3) 16

A software stack refers to a collection of technologies, programming languages, and software components that work together to develop applications or services This stack typically includes operating systems, application servers, databases, frameworks, libraries, and development tools, all of which are essential for both the development and execution of software solutions.

Performed Student: Vu Phong Thai 16

The MEAN stack is a JavaScript-based framework used for developing dynamic websites and web applications Variants of this stack include MERN, which substitutes Angular with React.js, and MEVN, which utilizes Vue.js as its interface.

Performed Student: Vu Phong Thai

The MERN stack is a powerful web development framework that combines MongoDB, Express.js, React.js, and Node.js It is a popular variation of the MEAN stack, offering developers a robust set of tools for building dynamic web applications.

The MEVN stack is an open-source JavaScript framework that offers a scalable solution for developing dynamic web applications By integrating its software components, developers can enhance both front-end and back-end efficiency, ultimately improving the overall functionality of websites and applications.

Performed Student: Vu Phong Thai 18

Definition: LAMP Stack is a traditional software stack for developing web applications, consisting of:

Performed Student: Vu Phong Thai 19

‘BTEC $ toe wih BIG e42e ‘BT E Cc

Why You Should Use Software StaCKS: nen HH HH tre 20

Reasons to Use a Software Stack:

Save Time and Effort: Using a pre-configured software stack reduces the time and effort required to program key components by to start from scratch

Ensure good integration: The components of the software stack are frequently tested and compatible with each other, ensuring good integration between the parts

Large community support: Software stacks often include a large community, meaning it's easier to find help and documentation

Performance and Security: Software stacks can be optimized for performance and security, so applications run more smoothly and securely

Performed Student: Vu Phong Thai 20

cccccccccsc cnc cccnecneneenecnesnenecnenecneceenecneeenesiessssesnenecneceeneeneeenesiesisnesnenecneneeneenesenesneseeness 21

In this report, I examined the ethical implications of using user data for business intelligence, highlighting the importance of these tools in supporting informed decision-making Additionally, I discussed the legal aspects related to Data Structures and Algorithms, offering relevant insights tailored to various scenarios.

In a case study on Lotte, I explored the challenges the organization faced and demonstrated how they effectively utilized Business Intelligence (BI) to solve problems and improve operations Additionally, I analyzed real-world examples of businesses employing BI technologies to enhance and optimize their operations, showcasing the potential for increased outreach and growth.

Business Intelligence is an invaluable asset that has deepened my understanding of the functionality of the devices around us This enlightening journey has significantly expanded my knowledge, and I am truly grateful to my mentor for their guidance throughout this exploration.

Performed Student: Vu Phong Thai 21

‘BTEC $ toe wih BIG e42e ‘BT E Cc

22

This report explores the detrimental impacts of digital technology on human health, outlining the project's goals and objectives A comprehensive project management plan was developed, addressing key elements such as cost, scope, timing, quality, communication, risk, and resources To ensure effective tracking of progress, a work analysis structure and Gantt Chart were created Additionally, small-scale research was conducted utilizing qualitative and quantitative methods for information gathering and data collection, which aided in forming a knowledge base for the project The accuracy and reliability of the various research methods employed were also evaluated.

Performed Student: Vu Phong Thai 22

Ngày đăng: 12/04/2025, 22:40

Nguồn tham khảo

Tài liệu tham khảo Loại Chi tiết
1. Resources, W., Guides, W. and Validity, R., 2021. Reliability And Validity - The WAC Clearinghouse. [online] Wac.colostate.edu.Available at: https://wac.colostate.edu/resources/writing/guides/reliability-validity/ [Accessed January 2021] Sách, tạp chí
Tiêu đề: Reliability And Validity - The WAC Clearinghouse
Tác giả: Resources, W., Guides, W., Validity, R
Nhà XB: The WAC Clearinghouse
Năm: 2021
2. Comp Sci Station. 2021. Types Of Resources In Project Management - Comp Sci Station. [online] Available at: https://compscistation.com/types-of-resources-in-project-management/ [Accessed January 2021] Sách, tạp chí
Tiêu đề: Types Of Resources In Project Management
Tác giả: Comp Sci Station
Nhà XB: Comp Sci Station
Năm: 2021
3. Apm.org.uk. 2021. What Is A Gantt Chart? | Definition & Exam- ples | APM. [online] Available at:https://www.apm.org.uk/resources/find-a-resource/gantt-chart/[Accessed January 2021] Sách, tạp chí
Tiêu đề: What Is A Gantt Chart? | Definition & Examples | APM
Nhà XB: APM
Năm: 2021
4. QuestionPro. 2021. Secondary Research- Definition, Methods And Exam- ples. | Questionpro. [online]Available at: https://www.questionpro.com/blog/secondary-research/ [Accessed January 2021] Sách, tạp chí
Tiêu đề: Secondary Research- Definition, Methods And Examples
Tác giả: QuestionPro
Nhà XB: Questionpro
Năm: 2021
5. Eade, D., 2021. What Is A Project Milestone And Why Are They Im- portant?. [online] Workflowmax.com.Available at: https://www.workflowmax.com/blog/general-project-milestone [Accessed 25 January 2021] Sách, tạp chí
Tiêu đề: What Is A Project Milestone And Why Are They Important
Tác giả: D. Eade
Nhà XB: Workflowmax.com
Năm: 2021