










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Typology: Assignments
1 / 18
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 April 12, 2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Lê Hoàng Hiệp Student ID GCS Class GCS0805A_PPT Assessor name Vũ Thanh Hiề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 Hiệp Grading grid P1 P2 P3 M1 M2 M3 D1 D
Grade: Assessor Signature: Date: Internal Verifier’s Comments: IV Signature:
a formal notation. Tasks Part 1 You will need to prepare a presentation on how to create a design specification for data structures, explaining the valid operations that can be carried out on the structures using the example of:
notation D2 Discuss the view that imperative ADTs are a basis for object orientation and, with justification, state whether you agree. P3 Using an imperative definition, specify the abstract data type for a software stack. M3 Examine the advantages of encapsulation and information hiding when using an ADT.
ASSIGNMENT 1 ANSWERS P1 Create a design specification for data structures explaining the valid operations that can be carried out on the structures.
− Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations. − The definition of ADT only mentions what operations are to be performed but not how these operations will be implemented. It does not specify how data will be organized in memory and what algorithms will be used for implementing the operations. It is called “abstract” because it gives an implementation-independent view. The process of providing only the essentials and hiding the details is known as abstraction. − The user of data type does not need to know how that data type is implemented, for example, we have been using Primitive values like int, float, char data types only with the knowledge that these
data type can operate and be performed on without any idea of how they are implemented. So, a user only needs to know what a data type can do, but not how it will be implemented. Think of ADT as a black box which hides the inner structure and design of the data type. Now we’ll define three ADTs namely List ADT, Stack ADT, Queue ADT.
List Abstract Data Type is a collection of elements that have a linear relationship with each other. A linear relationship means that, except for the first one, each element on the list has a unique successor. Also lists have a property intuitively called size, which is simply the number of elements on the list. List is mutable. List is also an interface, which means that other classes provide the actual implementation of the data type. These classes include ArrayList which is implemented internally using Arrays and LinkedList which is implemented internally using LinkedList data structure.
Java data structures like java.util.LinkedList , java.util.concurrent.ArrayBlockingQueue implement Queue ADT using LinkedList and ArrayLists internally respectively. The operations on the queue ADT can be described like below Creators : Constructor of java.util.LinkedList. Producers : Constructor method LinkedList(Collection c) of java.util.LinkedList. Observers : peek() method of java.util.LinkedList. Mutators : add(E item) method of java.util.LinkedList. Java library provides the below following operations which can be performed on java.util.Queue add(E e) – Queues an element at the end of queue. remove() – Dequeues an element from the head of the queue. peek() – Returns the element of the queue without removing it. offer(E e) – Inserts the specified element into this queue if it is possible to do without violating capacity restrictions. size() – Returns the size of the queue. P2 Determine the operations of a memory stack and how it is used to implement function calls in a computer.
system, Apache web server, MySQL relational database management system and the PHP programming language. 3.3.2. MEAN - Dynamic web sites and web applications are builds using the MEAN software stack, which includes four free and open-source components: a database tool called MongoDB, the Express.js web application server framework, a front-end web framework called Angular.js, and the Node.js runtime environment. 3.3.3. WIMP - The WIMP software stack includes the Windows operating system, IIS web servers, MySQL or MS Access as a data management system and the PHP, Perl or Python programming languages. 3.3.4. NMP - NMP is actually a set of several software stacks that incorporate Nginx web servers, MySQL and the PHP programming language. This set of technologies works with all major operating systems and has been packaged separately with Linux, Windows, and macOS. 3.3.5. MAMP - The MAMP framework can be used to develop web sites that function on computers that use Windows or macOS. The software stack consists of either macOS or Windows operating system, Apache web server, MySQL for relational database management and PHP, Perl or Python for web development.
REFERENCES
1. Adam Drozdek. Data Structures and Algorithms in Java: SECOND EDITION. Available at: file:///C:/Users/ASUS/Downloads/Data%20Structures%20and%20Algorithms%20in %20Java.pdf [Accessed April 12, 2021] 2. Wu, C. Thomas. An Introduction to Object-Oriented Programming with Java, 5th Edition. Available at: file:///C:/Users/ASUS/Downloads/An%20Introduction%20to%20Object-Oriented %20Programming%20with%20Java,%205th%20Edition.pdf [Accessed April 12, 2021] 3. Aarish Ramesh. ADT Java Tutorial. Available at: https://examples.javacodegeeks.com/adt-java-tutorial/#section [Accessed April 12, 2021] 4. Abstract Data Type (ADT) Available at: https://www.cpp.edu/~ftang/courses/CS240/lectures/adt.htm [Accessed April 12, 2021] 5. Reading 11: Abstract Data Types Available at: https://web.mit.edu/6.005/www/fa16/classes/11-abstract-data-types/ [Accessed April 12, 2021] 6. Array implementation of Stack Available at: https://www.javatpoint.com/ds-array-implementation-of-stack [Accessed April 12, 2021] 7. Java Stack Implementation using Array Available at: https://howtodoinjava.com/data-structure/java-stack-implementation-array/ [Accessed April 12, 2021] 8. Software Stack