1649 - Data Structures & Algorithms - ASM2, Assignments of Information Technology

hope it can help u pass in the asm

Typology: Assignments

2022/2023

Uploaded on 08/03/2023

andrew-2709
andrew-2709 🇻🇳

4.8

(20)

33 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Higher Nationals in Computing
Unit 19: Data Structures and Algorithms
ASSIGNMENT 2
Assessor name: PHAN MINH TAM
Learner’s name: Dương Trng Q
ID: GBS200716
Class: GCS1005A
Subject code: 1649
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download 1649 - Data Structures & Algorithms - ASM2 and more Assignments Information Technology 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: Dương Trọng Quí

ID: GBS

Class: GCS1005A

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 Dương Trọng Quí Student ID GBS Class GCS1005A 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

  • defined problem. P4 Implement a complex ADT and algorithm in an executable programming language to solve a well
    • 1 Queue solution:
      • 1.1. Node class:
      • 1.2. Queue class:
      • 1.3. Queue Application class:
      • 1.4. Screenshot:
      1. Stack Solution:
      • 2.1. Node class:
      • 2.2. Stack class:.........................................................................................................................
      • 2.3. Stack Application class:
      • 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:................................................................................................................
      • 1.1. Definition:
      • 1.2. Asymptotic notations:
      • 1.2.1. Big O notation (O):
      • 1 .2.2. Omega Notation (Ω):
      • 1.2.3. Theta Notation (θ):
      • 1.3. Common Asymptotic notations:
      • 1.4. How to find time complexity?
    • 2 Example:
  • answer with an example. P7 Determine two ways in which the efficiency of an algorithm can be measured, illustrating your
      1. Two main measures for the efficiency of an algorithm:
      • 1.1. Time complexity:
      • 1.2. Space complexity:
    • REFERENCES

P a g e | 1 ASSIGNMENT 2 ANSWERS

P4 Implement a complex ADT and algorithm in an executable programming language

to solve a well defined problem.

1. Queue solution: 1.1. Node class: Explanation: Node class contains two properties: data and next. Data is used to hold the sender's message before it is conveyed to the recipient, and it points to the node immediately adjacent to each node.

P a g e | 3 Explanation: There are three attributes in the Queue class: front, rear, and nodesCount.

  • Front is used to specify which node is the current node's front node and to assess whether or not this node possesses the front node.
  • Rear is used to establish the rear node for the current node and to ascertain whether or not this node has a rear node.
  • To determine whether there are any nodes in the queue, use nodesCount.

P a g e | 4 1.3. Queue Application class: Explanation: The Queue Application class, also known as the main class, is used to represent the operations declared in the Node and Queue classes. Additionally, I created a system that satisfies the task's requirements for sending and receiving messages via a queue.

P a g e | 6

  • Option 3 :
  • Option 4 : 2. Stack Solution: 2.1. Node class:

P a g e | 7 Explanation: Node class contains two properties: data and next. Data is used to hold the sender's message before it is conveyed to the recipient, and it points to the node immediately adjacent to each node.

P a g e | 9 Explanation: In the Stack class, Top and nodesCount are two properties. The top node of the stack, or the most recent message added to the stack, is set using the node function top, which is likewise a node. Similar to the nodesCount of Queue, nodesCount is used to determine whether there are any nodes in Stack. 2.3. Stack Application class:

P a g e | 10 Explanation: The Stack application class, also known as the main class, represents the actions stated in the Node and Stack classes. Additionally, I created a system that satisfies the task's requirements for using a Stack to send and receive messages. 2.4. Screenshot:

  • The application Interface:

P a g e | 12

  • Option 4 :

P5 Implement error handling and report test results.

No. Actions Input test data Output test results 1. Select option 1 in Queue menu Hi I’m Qui The message “Hi I’m Qui ” is stored into the queue 2. Select option 1 in Queue menu i feel so tired The message “i feel so tired ” is stored into the queue 3. Select option 1 in Queue menu =))) okay The message “=))) okay” is stored into the queue 4. Select option 2 in Queue menu There is no input required for option 2 Message from queue by order: “=))) okay” 5. Select option 3 in Queue menu There is no input required for option 3 All Message in the Queue: 1. Hi im Qui 2. i feel so tired 3. okay :)))) 6. Select option 4 in Queue menu There is no input required for option 4 The IDE announce that BUILD SUCCESS 7. Select option 1 in Stack menu Boring The Message was added in the stack: Boring 8. Select option 1 in Stack menu Sad The Message was added in the stack: Sad

P a g e | 13 9. Select option 1 in Stack menu Sleep The Message was added in the stack: Sleep 10. Select option 2 in Stack menu There is no input required for option 2 Message from Stack by order: Sleep 11. Select option 2 in Stack menu There is no input required for option 2 Message from Stack by order: Sad 12. Select option 2 in Stack menu There is no input required for option 2 Message from Stack by order: Boring 13. Select option 3 in Stack menu There is no input required for option 3 Message in the Stack: Sleep - > Boring - > Sad - > Null 14. Select option 1 in Stack menu Qui The Message was added in the stack: Qui 15. Select option 1 in Stack menu GBS200716 The Message was added in the stack: GBS 16. Select option 2 in Stack menu There is no input required for option 2 Message from Stack by order: GBS 17. Select option 2 in Stack menu There is no input required for option 2 Message from Stack by order: Qui 18. Select option 3 in Stack menu There is no input required for option 3 Message in the Stack:GBS200716 - > Qui - > Null 19. Select option 2 in Stack menu There is no input required for option 2 Enter your message: Stack underflow 20. Select option 4 in Stack menu There is no input required for option 4 The IDE announce that BUILD SUCCESS

P6 Discuss how asymptotic analysis can be used to assess the effectiveness of an

algorithm.

1. Asymptotic analysis: 1.1. Definition: Asymptotic analysis is the act of determining an algorithm's running time in mathematical units to