Docsity

data computer 1data computer 1, Cheat Sheet of Database Programming

Partial preview of the text

Download data computer 1data computer 1 and more Cheat Sheet Database Programming in PDF only on Docsity!

Higher Nationals in Computing

Unit 19: Data Structures and Algorithms

ASSIGNMENT 2

Assessor name: PHAN MINH TAM

Learner’s name: Đào Vĩnh Khang

ID: GCS

Class: GCS0905B

Subject code: 1649

Assignment due: Assignment submitted:

ASSIGNMENT 2 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 DAO VINH KHANG Student ID GCS

Class GCS0905B Assessor name Phan Minh Tam

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

P4 P5 P6 P7 M4 M5 D3 D

ASSIGNMENT 2 BRIEF

Qualification BTEC Level 5 HND Diploma in Business

Unit number Unit 1 9 : Data Structures and Algorithms

Assignment title Implement and assess specific DSA

Academic Year 2022

Unit Tutor TamPM

Issue date 12 - Sep- 2022 Submission date

IV name and date

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. Unit Learning Outcomes:

LO3 Implement complex data structures and algorithms

LO4 Assess the effectiveness of data structures and algorithms

Assignment Brief and Guidance: Assignment scenario Continued from Assignment 1.

Tasks

For the middleware that is currently developing, one part of the provision interface is how message can be transferred and processed through layers. For transport, normally a buffer of queue messages is implemented and for processing, the systems requires a stack of messages. The team now has to develop these kind of collections for the system. They should design ADT / algorithms for these 2 structures and implement a demo version with message is a string of maximum 250 characters. The demo should demonstrate some important operations of these structures. Even it’s a demo, errors should be handled carefully by exceptions and some tests should be executed to prove the correctness of algorithms / operations. The team needs to write a report of the implementation of the 2 data structures and how to measure the efficiency of related algorithms. The report should also evaluate the use of ADT in design and development, including the complexity, the trade-off and the benefits.

Table of Contents

1.1. Definition Asymptotic analysis is the process of calculating the running time of an algorithm in mathematical units to find the program's limitations, or "run-time performance."

P a g e | 2

1.3 application

P a g e | 3

1.4 screenshot

option 1

option 2

P a g e | 5

2.2 Stack

  • Unit 19: Data Structures and Algorithms ASSIGNMENT Contents
  • problem. P4 Implement a complex ADT and algorithm in an executable programming language to solve a well defined
      1. Queue solution
      • 1.1 node
      • 1.2 queue
      • 1.3 application
      • 1.4 screenshot.............................................................................................................................................
      1. Stack solution
      • 2.1 node
      • 2.2 Stack
      • 2.3 Application
      • 2.4 screenshot...................................................................................................................................................
  • P5 Implement error handling and report test results.
  • P6 Discuss how asymptotic analysis can be used to assess the effectiveness of an algorithm
      1. Asymptotic analysis
      • given task. The goal is to determine the best case, worst case and average case time required to execute a
      • Worst Case - Maximum time required for program execution. - 1.2. Asymptotic Notations - 1.2.1 Big Oh Notation, Ο - 1.2.2 Omega Notation, Ω - 1.2.3 Theta Notation, θ - 1.3. Common asymptotic

  • P7 Determine two ways in which the efficiency of an algorithm can be measured, illustrating your
    • 1.1/ Time complexity
    • 1.2/ Space complexity
    • 2/ Demonstration
  • P a g e |

P a g e | 8

2.4 screenshot

P a g e | 9

P5 Implement error handling and report test results.

No1 Actions Input test data Output test results 1 Enter a message. The^ Enter your message. If it exceeds 250^ The length limit of string is

P a g e | 11

  1. Asymptotic analysis 1.1. Definition Asymptotic analysis is the process of calculating the running time of an algorithm in mathematical units to find the program's limitations, or "run-time performance." The goal is to determine the best case, worst case and average case time required to execute a given task.

    Best Case - Minimum time required for program execution. Average Case - Average time required for program execution. Worst Case - Maximum time required for program execution. 1.2. Asymptotic Notations

Following are the commonly used asymptotic notations to calculate the running time

complexity of an algorithm.

  • Ο Notation
  • Ω Notation
  • θ Notation

1.2.1 Big Oh Notation, Ο

The notation Ο(n) is the formal way to express the upper bound of an algorithm's running time.

It measures the worst case time complexity or the longest amount of time an algorithm can

possibly take to complete.

For example, for a function f (n)

P a g e | 12

1.2.2 Omega Notation, Ω

The notation Ω(n) is the formal way to express the lower bound of an algorithm's running time.

It measures the best case time complexity or the best amount of time an algorithm can possibly

take to complete.

For example, for a function f (n)

1.2.3 Theta Notation, θ

The notation θ(n) is the formal way to express both the lower bound and the upper bound of

an algorithm's running time. It is represented as follows –