1649 Assignment1
1649 Assignment1
Unit number and title Unit 19: Data Structures and Algorithms
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
P1 P2 P3 M1 M2 M3 D1 D2
❒ Summative Feedback: ❒ Resubmission Feedback:
12 – September –
Issue date Submission date
2022
Submission Format:
Format:
● The submission is in the form of an individual written report and a presentation. This should be written in a concise,
formal business style using single spacing and font size 12. You are required to make use of headings, paragraphs and
subsections as appropriate, and all work must be supported with research and referenced using the Harvard referencing
system. Please also provide a bibliography using the Harvard referencing system.
Submission
● Students are compulsory to submit the assignment in due date and in a way requested by the Tutor.
● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/.
● Remember to convert the word file into PDF file before the submission on CMS.
Note:
● The individual Assignment must be your own work, and not copied by or from another student.
● If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must reference your
sources, using the Harvard style.
● Make sure that you understand and follow the guidelines to avoid plagiarism. Failure to comply this requirement will
result in a failed assignment.
Assignment scenario
You work as in-house software developer for Softnet Development Ltd, a software body-shop providing network provisioning
solutions. Your company is part of a collaborative service provisioning development project and your company has won the
contract to design and develop a middleware solution that will interface at the front-end to multiple computer provisioning
interfaces including SOAP, HTTP, JML and CLI, and the back-end telecom provisioning network via CLI .
Your account manager has assigned you a special role that is to inform your team about designing and implementing abstract
data types. You have been asked to create a presentation for all collaborating partners on how ADTs can be utilised to improve
software design, development and testing. Further, you have been asked to write an introductory report for distribution to all
partners on how to specify abstract data types and algorithms in 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:
1. A stack ADT, a concrete data structure for a First In First out (FIFO) queue.
2. Two sorting algorithms.
3. Two searching algorithms.
4. Two network shortest path algorithms.
Part 2
You will need to provide a formal written report that includes the following:
1. Explanation on how to specify an abstract data type using the example of software stack.
2. Explanation of the advantages of encapsulation and information hiding when using an ADT.
3. Discussion of imperative ADTs with regard to object orientation.
Learning Outcomes and Assessment Criteria (Assignment 1)
P1 Create a design specification for data structures explaining the valid operations that
can be carried out on the structures......................................................1
I. Introduction to Abstract Data Type ( ADT ).........................................1
I.I What is ADT?..................................................................1
I.II The benifits of ADT..........................................................1
I.III ADT examples................................................................2
I.IV ADT vs OOP...................................................................2
II. Linear Data Structures............................................................3
II.I Definition ..................................................................3
II.II Linked List.................................................................3
II.III Stack......................................................................3
II.IV Queue.......................................................................3
III. Sorting Algorithms...............................................................3
IV. Searching Algorithms..............................................................3
P2 Determine the operations of a memory stack and how it is used to implement function
calls in a computer.......................................................................4
P3 Using an imperative definition, specify the abstract data type for a software stack....4
REFERENCES...............................................................................4
ASSIGNMENT 1 ANSWERS
P1 Create a design specification for data structures
explaining the valid operations that can be carried out on the
structures.
Page | 1
1.3 ADT examples
List ADT: The data is generally stored in key sequence in a list which has a
head structure consisting of count, pointers and address of compare function needed
to compare the data in the list.
The List ADT Functions is given below:
get() – Return an element from the list at any given position.
insert() – Insert an element at any position of the list.
remove() – Remove the first occurrence of any element from a non-empty list.
removeAt() – Remove the element at a specified location from a non-empty list.
replace() – Replace an element at any position by another element.
size() – Return the number of elements in the list.
isEmpty() – Return true if the list is empty, otherwise return false.
ADT OOP
Abstract data type is abstraction that It is a self-contained component which
define set of values and set of consists of methods and properties to
operations on these values. make certain type of data useful.
User-defined data type. It is an instance of class.
ADT is made of with primitive datatypes. An object is an abstract data type with
the addition of polymorphism and
inheritance.
It is a type (or class) for objects It is a basic unit of Object-Oriented
whose behaviour is defined by a set of Programming.
value and a set of operations.
Abstract datatype is not necessarily an Objects is an OOP concept.
OOP concept.
Common examples include lists, stacks, Objects have states and behaviours
sets, etc. Test t = new Test();.
Allocate memory when data is stored. When we instantiate an object then
Page | 2
memory is allocated.
2.1 Definition
A linear data structure has data elements connected to each other so that elements
are arranged in a sequential manner and each element is connected to the element in
front of it and behind it. This way, the structure can be traversed in a single
run.
2.2 Array
A linked list is a linear data structure in which elements are linked using
pointers. It consists of nodes where each node contains a data field and a
reference(link) to the next node in the list.
Page | 3
Searching: To search an element(s) by value.
https://www.programiz.com/dsa/linked-list-operations
2.4 Stack
2.4.1 Definition
https://www.tutorialspoint.com/data_structures_algorithms/stack_algorithm.htm
2.5 Queue
2.5.1 Definition
A queue is defined as a linear data structure that is open at both ends and
Page | 4
the operations are performed in First In First Out (FIFO) order.
Peek: Acquires the data element available at the front node of the queue without
deleting it.
https://www.geeksforgeeks.org/queue-data-structure/
3 Sorting Algorithms
3.1 Defiition
Bubble sort starts with very first two elements, comparing them to check which one
is greater.
In this case, value of 3 is less than 5, so we swap the value 3 with the value 5.
Next, we compare 5 with 8.
The process is repeated until all values are in their correct places.
Page | 6
https://viblo.asia/p/thuat-toan-sap-xep-noi-bot-bubble-sort-m68Z0exQlkG
4 Searching Algorithms
Sequential Search
Interval Search
Page | 7
P2 Determine the operations of a memory stack and how it is
used to implement function calls in a computer.
1 Definition
Stacks in Computer Memory are linear data structures (locations) used to store data
in a computer's memory. They may also be referred to as queues. Data within a stack must
always be of the same type.
PUSH operation: refers to inserting an element in the stack. Since there’s only one
position at which the new element can be inserted — Top of the stack, the new element is
inserted at the top of the stack.
POP operation: refers to the removal of an element. Only has access to the element at
Page | 8
the top of the stack, so only a single element can be deleted. So only delete the top
part of the stack.
Peek operation allows the user to see the element on the top of the stack. The stack is
not modified in any manner in this operation.
REFERENCES
Page | 9
Harvard Reference List Citations for Books:
Last name, First initial. and Last name, First initial. (Year published). Title. City:
Publisher, Page(s).
Examples:
Desikan, S. and Ramesh, G. (2006). Software testing. Bangalore, India: Dorling
Kindersley, p.156
Daniels, K., Patterson, G. and Dunston, Y. (2014). The ultimate student
teaching guide. 2nd ed. Los Angeles: SAGE Publications, pp.145-151
Examples:
P a g e | 10