ASSIGNMENT 1 FRONT SHEET Qualification Qualificati on
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 19: Data Structures and Algorithms Algorithms
11/8/2021
Submission date
Date Received 1st submission submission
Re-submission Date Date
Date Received 2nd submission submission
Bui Hoang Bao Anh
Student Name
GCD0806
Class
GDD19909
Student ID
Ho Van Phi
Assessor name
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.
Anh
Student’s signature signature Grading grid P1
P2
P3
M1
M2
M3
D1
D2
Resubmission Feedback:
Summative Summative Feedback:
Grade:
Assessor Signature:
Internal Verifier’s Comments: Comments:
Date: Date:
IV Signature: Signature:
Table of Contents CHAPTER 1: Create a design specification for data structures explaining the valid operations that can be ccarried arried out
on the structures. ______________________________________ _________________________________________________________ ______________________________________ ___________________ 4 Chapter 2: Determine the operations of a memory stack and how it is used to implement function calls in a computer. ____________________________________ ______________________________________________________ ______________________________________ _________________________ _____ 13 Chapter 3: Using an imperative definition, specify the abstract data type for a software stack. ___________ ___________ 19
Table of figures Figure 1: Abstract data type ......................................................................................................................................... 4 Figure 2: Example of system design Abstract data type ............ ..................... .................. .................. .................. .................. ................... ................... .................. .................. ........... 5 Figure 3: the list of adt functions .................................................................................................................................. 7 Figure 4: Queue ............................................................................................................................................................ 8 Figure 5: Example for Queue: ....................................................................................................................................... 9 Figure 6: The result ..................................................................................................................................................... 12 Figure 7: Stack ............................................................................................................................................................. 13 Figure 8: The example of stack ................................................................................................................................... 14 Figure 9: The example of Stack ................................................................................................................................... 16 Figure 10: The result ................................................................................................................................................... 16 Figure 11: Example ...................................................................................................................................................... 18 Figure 12: Stack Data Structure .................................................................................................................................. 21 Figure 13: Example for implement stack .................................................................................................................... 22 Figure 14: The result ................................................................................................................................................... 23
CHAPTER 1: Create a design specification for data structures explaining the valid operations that can be carried out o ut on the structures. 1) What is an Abstract Data Type. Abstract Data type (ADT) is a type (or class) for objects whose behaviour is defined by a set of value and a set of operations. It also provides the interface of the object. Therefore, this type is called abstract because it does not give an implementation perspective. An abstract data type should include the following: o Declaration of data of operations Declaration Encapsulation of data and operations: data is hidden from user and can be manipulated only by
o
o
mean of operations
2) ADT from definition to implementation.
Figure 1: Abstract data type
2.1 ) Definition: The abstract data type (ADT) definition only refers to what activities will be performed, not how this operation will be performed. Moreover, it does not specify how the data will be organized in memory and which algorithm will be used to perform the operations. So why is it called online abstraction? Because it brings an independent look done.
For exam
ple :
we have used primitive values such as integers (int), real numbers (float), character types (char), string types (string), and so on, only with knowledge of which type This data can work without any idea of how they are implemented. So users only need to know what kind of data they can do, not how to deploy it. Think of ADT as a black box that hides the internal structure and design of the data type.
Figure 2: Example of system design Abstract data type
2.2) Implementation of an Abstract Data Type. Hidden from user. Same ADT may be implemented implemented in diffference ways in differenence ways in different languaes.
Some languaes offer build in Abstract data types or feature to be used to implement Abstract data
types ( user define types ).
ADT support modular design which is very important in software development
2.3) List of Abstract data type. A list abstract data type is the type of list which contains similar elements in sequential order and following are the operations which can be performed on list.
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.