















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
assignment 1 1644 Cloud Computing
Typology: Cheat Sheet
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















Student Name/ID Number: Nguyễn Xuân Nam/ GCS Unit Number and Title: Unit 19: Data Structures and Algorithms Academic Year: 2021 – 2022 Unit Assessor: Lê Ngọc Thành Assignment Title: Data Structures and Algorithms Issue Date: April 1st, 2021 Submission Date: Internal Verifier Name: Date: Submission Format: Format: The submission is in the form of 1 document You must use font Calibri size 12, set number of the pages and use multiple line spacing at 1.3. Margins must be: left: 1.25 cm; right: 1 cm; top: 1 cm and bottom: 1 cm. The reference follows Harvard referencing system. Submission Students are compulsory to submit the assignment in due date and in a way requested by the Tutors. The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/ Note: The Assignment must be your own work, and not copied by or from another student or from ● books etc. 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 know how to reference properly, and that understand the guidelines on plagiarism. If you do not, you definitely get failed Unit Learning Outcomes: 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:
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.
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 data node contains the pointer to a data structure and a self-referential pointer which points to the next node 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. isFull() – Return true if the list is full, otherwise return false.
In Stack ADT Implementation instead of data being stored in each node, the pointer to data is stored. The program allocates memory for the data and address is passed to the stack ADT. The head node and the data nodes are encapsulated in the ADT. The calling function can only see the pointer to the stack. The stack head structure also contains a pointer to top and count of number of entries currently in stack. push() – Insert an element at one end of the stack called top. pop() – Remove and return the element at the top of the stack, if it is not empty. peek() – Return the element at the top of the stack without removing it, if the stack is not empty. size() – Return the number of elements in the stack. isEmpty() – Return true if the stack is empty, otherwise return false. isFull() – Return true if the stack is full, otherwise return false.
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.
It is a temporary storage memory. When the computing task is complete, the memory of the variable will be automatically erased. The stack section mostly contains methods, local variable, and reference variables. The stack's memory is accessed in LIFO (Last In First Out) order. To be more specific, stack storage. When a method is invoked, a stack memory block containing local primitives and object references is created. When the method is completed, the block is deactivated and passed on to the next method. Stack memory is quite little in comparison to Heap memory.
The stack is responsible for the following core operations:
Some other features of stack memory include: It grows and shrinks as new methods are called and returned, respectively. Variables inside the stack exist only as long as the method that created them is running. It's automatically allocated and deallocated when the method finishes execution. If this memory is full, Java throws java.lang.StackOverFlowError. Access to this memory is fast when compared to heap memory. This memory is threadsafe, as each thread operates in its own stack.
When a function is called, a block at the top of the stack is assigned to local variables and specific accounting data. The block will not be used when the function returns, but it can be used in a later function call. Stacks are always arranged in LIFO (last in, first out) order, with the most recently reserved block being released first. This simplifies stack tracing as removing a block from the stack is as simple as changing a reference.
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 following image illustrates a memory stack implemented function call: +When a function call occurs, prior variables are saved in the stack. +Returning value from base case to caller function:
Java collection framework was non-generic before JDK 1.5. Since 1.5, it is generic. Java new generic collection allows you to have only one type of object in a collection. Now it is type-safe, so typecasting is not required at runtime. Let's see the old non-generic example of creating a Java collection. Let's see the new generic example of creating java collection. In a generic collection, we specify the type in angular braces. Now ArrayList is forced to have the only specified type of object in it. If you try to add another type of object, it gives a compile- time error.
size(), isEmpty(), get(), set() – all return O add() — this operation is performed in amortized constant time. Adding n elements takes O(n) time; all other operations, such as add(int index, E element), contains(), indexOf(), remove(int index), and so on, take linear time.
CONCLUSION: After completing this report, I have learned a lot of previously unknown information and gained a lot of new and important information. With my new understanding of data structures and algorithms, I will be better able to prepare my classes in the future. Most importantly, I would like to thank my teachers for their enthusiastic guidance and help.