
















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!

















ASSIGNMENT 1 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 19: Data Structures and Algorithms Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyễn Xuân Nam Student ID GCS Class GCS0905A Assessor name Lê Ngọc Thành 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
Grade: Assessor Signature: Date: Lecturer Signature:
LO1 Demonstrate an understanding of the fundamentals of Cloud Computing and its architectures. LO2 Evaluate the deployment models, service models and technological drivers of Cloud Computing and validate their use. Assignment Brief and Guidance: Scenario ATN is a Vietnamese company which is selling toys to teenagers in many provinces all over Vietnam. The company has the revenue over 700.000 dollars/year. Currently each shop has its own database to store transactions for that shop only. Each shop has to send the sale data to the board director monthly and the board director need lots of time to summarize the data collected from all the shops. Besides the board can’t see the stock information update in real time. The table of contents in your technical report should be as follows:
Learning Outcomes and Assessment Criteria Pass Merit Distinction LO1 Examine abstract data types, concrete data structures and algorithms D1 Analyse the operation, using illustrations, of two network shortest path algorithms, providing an example of each.solution. P1 Create a design specification for data structures explaining the valid operations that can be carried out on the structures. P2 Determine the operations of a memory stack and how it is used to implement function calls in a computer. M1 Illustrate, with an example, a concrete data structure for a First In First out (FIFO) queue. M2 Compare the performance of two sorting algorithms. LO2 Specify abstract data types and algorithms in a formal 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.
Introduction In this assignment, I will create a design specification for a data structure that describes the legal operations that can be performed on that structure. Then I'll explain how the memory stack works and how it's used in computers to make function calls. Finally, I will use imperative descriptors to describe the abstract data types of the software stack.
1. Data Structures 1.1 Abstract data type
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of values 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 queue abstract data type (ADT) follows the basic design of the stack abstract data type. Each node contains a void pointer to the data and the link pointer to the next element in the queue. The program’s responsibility is to allocate memory for storing the data. enqueue() – Insert an element at the end of the queue. dequeue() – Remove and return the first element of the queue, if the queue is not empty. peek() – Return the element of the queue without removing it, if the queue is not empty. size() – Return the number of elements in the queue. isEmpty() – Return true if the queue is empty, otherwise return false. isFull() – Return true if the queue is full, otherwise return false.
Abstraction: The user does not need to know the implementation of the data structure. Better Conceptualization: ADT gives us a better conceptualization of the real world. Robust: The program is robust and has the ability to catch errors.
Generally data types define what kind of data can be stored in them. There are two types of data types, i.e primitive data types and the abstract data types. Primitive data types are those which are used generally like int,char, float,etc., wheres as the abstract data types are defined by using the primitive data types. For example, stack, list, queue, etc. They are called as abstract because they hide the implementation details, i.e, you will be knowing what are the functions that can be applied on these ADTs but you will not be knowing how the function operates. ADTs basically come from the C++ STL. 1.2 ADT usages
A stack is a special area of computer’s memory which stores temporary variables created by a function. In stack, variables are declared, stored and initialized during runtime.
Program to calculate the sum of a sequence of numbers: If n is equal to the length of the array minus one, the above method will call itself and the value of n will be decremented by one on each call until the base case yields the first unit. Then the return values of each function call are advanced until the original function is reached and the result is provided. The base case ensures that the function does not make any subsequent recursive calls. If no base case is supplied, the function will continue to call itself until memory is exhausted, resulting in a stack overflow. As a result, a recursive function must have a base case in order to function.
The calls in the example are 'stacked' on top of each other since they are dependent on the outcomes of the preceding functions, and this stacking also makes the base case manageable. Stop the program. This is known as the call stack.
We need to create an array to hold the list of information. This list is sorted in such a way that we can quickly access each child element randomly. For example, if you want information about the 10th child, the system needs to show it immediately. Second, the list can be reorganized based on specific criteria, such as B. Filter out phrases based on the criteria of the top 10 students. After all, since we don't know how many elements there will be or if they will change, the size and elements of the array must be resizable.
1.3 The Software Stack
A software stack is a collection of independent components that work together to support the execution of an application. The components, which may include an operating system, architectural layers, protocols, runtime environments, databases and function calls, are stacked one on top of each other in a hierarchy. Typically, the lower-level components in the hierarchy interact with hardware, while the higher-level components in the hierarchy perform specific tasks and services for the end user. Components communicate directly with the application through a series of complex instructions that traverse the stack. An application is made up of a collection of functions that operate together in a defined architecture to provide certain services to the user. The most basic application architecture is made up of three layers: