0% found this document useful (0 votes)
78 views

1 - Data Structures and Algorithms Assignment After IV

This document provides an assignment brief for a unit on data structures and algorithms. It includes 4 tasks to design and implement various data structures and algorithms to solve problems related to order handling and delivery at MacDonald's. Task 1 involves queue implementation using linked lists to handle orders, stack implementation for plate storage, and comparing array-based and linked list queues. Task 2 discusses abstract data types and object-oriented principles. Task 3 implements sorting algorithms to sort orders and compares their performance. Task 4 finds shortest paths between branches using graph algorithms. Students are assessed on their ability to analyze, specify, implement and evaluate different data structures and algorithms.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

1 - Data Structures and Algorithms Assignment After IV

This document provides an assignment brief for a unit on data structures and algorithms. It includes 4 tasks to design and implement various data structures and algorithms to solve problems related to order handling and delivery at MacDonald's. Task 1 involves queue implementation using linked lists to handle orders, stack implementation for plate storage, and comparing array-based and linked list queues. Task 2 discusses abstract data types and object-oriented principles. Task 3 implements sorting algorithms to sort orders and compares their performance. Task 4 finds shortest paths between branches using graph algorithms. Students are assessed on their ability to analyze, specify, implement and evaluate different data structures and algorithms.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Luminus Technical University College -

Assignment Brief (RQF)


Higher National Diploma in computing
Language of assessment
AR EN
Student Name
College ID:
Pearson ID:
Unit Number and 19. Data Structures and Algorithms
Title
Academic Year 2022/2023
Unit Tutor Hala Majdalawi, Balqees Aldabaibeh
Internal Verifier Dr. Mohammad Eshtay Approval Date:
Name and
Approval
(Signature)
Assignment 1 Design and implement complex data structures and algorithms
number and Title
Issue Date (1St 18/4/2023 Submission Date (1st 13/6/2023
Submission) Submission)
Issue Date (2nd 21/6/2023 Completion Date (2nd 23/6/2023
Submission) Submission)
Submission Format
Code file, word document at least 1000 words, use consistent style and formatting.

Authenticity: Your proposed work should be authentic, and not copied from others. your answers have to
relate to the vocational scenario and not generally. 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.

Unit Learning Outcomes


LO1 Examine abstract data types, concrete data structures and algorithms.
LO2 Specify abstract data types and algorithms in a formal notation.
LO3 Implement complex data structures and algorithms.
LO4 Assess the effectiveness of data structures and algorithms.

Transferable skills and competencies developed

This assignment provides practice on designing and building data structures and utilize them
for building systems according to certain requirements.
Also, it teaches students to compare different algorithms and assess their effectiveness.
Along with the following:
- identify program data requirements.
- specify abstract data types using formal notation.
- translate into concrete data structures and be able to develop, using a programming
paradigm, different sorting, searching and navigational algorithms that implement
complex data structures and evaluate their effectiveness.

Vocational scenario:
You are working in a Tech Solutions company that designs and builds software
solutions for several clients.
Your company has won the bid to create an application that handle many required
services for MacDonalds. an application for handling different features for
MacDonalds services.
Consider the tasks below to implement the system.

Assignment activity and guidance

The application has many features as listed and explained in the following tasks:
Task 1: Handling Orders
Description: cars in drive thru line place their order once it is their turn. The
orders are delivered in a first-come-first-serve order.
1.1: Draw a class diagram that includes the following classes and show the
relationship between them, information hiding, and ADT specifications:
Order: each order placed from drive thru service contains: order ID, list of
items, total price. This class have an operation to calculate the total price
based on items (not user input), and a print operation.
Item: each item has a description and a price. For example, (Big Mac, 5.00)
Queue: implement over a DLL to handle orders. With main add and remove
operations of a queue.

DLL: customize the DLL class to store orders, and another one to store items.

The DLLOrder class has two operations, AddOrder that add an order to
the end of the list, and a RemoveOrder that return the removed order
from the head/front.
The DLLItems has only one operation (AddItem) that add an Item to the
end of the list.

1.2: Implement the solution according to the given classes and specifications, and
prevent handling orders when there are no orders in queue and prevent creating
invoice/total price for empty list of items .
1.3: Test your implementation using a Demo class , Figure 1 shows a sample testing.
Present how the specified ADT solves the given problem.
Figure 1 : sample testing

1.4: Draw an illustration to show how queue handles the orders in FIFO manner, give
examples.
1.5: Consider implementing the Queue class over an array, and SLL. Discuss the
implementation details in term of space and time complexities as well as the possible
trade-offs regarding queue specifications (enqueue and dequeue).
1.6: In Mac they have a job to put plates in a cabinet. The way they put the plates is
one on top of another until the cabinet is full. When they want to use the plates they
take the plate that is on top in the cabinet until they are all finished. They have
brought a robot to do the job. Help them by defining a stack specification so they
can use it to implement the solution, show how stack handle the solution.

Task 2: ADT and OOP


2.1: You have implemented the above solution using the Object-Oriented
Programming principles. Negotiate the idea that ADTs are the basis of object
orientation. Justify your answer whether you agree or disagree.
2.2: Explore the advantages of encapsulation and information hiding, class diagram
representation when using the queue ADT .
2.2: Assess three benefits of implementing independent Data Structure such as
queue.

Task 3: Testing sorting algorithms to improve orders handling


You have been asked to implement a feature to sort the orders before adding them
to the queue based in their total price. This will give orders with highest price the
priority to be handled first. For the easiness of implementation and demonstration,
assume that you are given an array of total prices. Sort it in descending order using
two sorting algorithms (merge sort and insertion sort). And compare their
performances using time benchmarking technique over three different shapes of
arrays.
Use the following table to organize your results, N is array size:
N= 100000 Sorted Reversely sorted Random
Merge sort Time in
nanoseconds
Insertion sort

3.1: Consider how asymptotic analysis is used to evaluate the effectiveness of


algorithms. Use the sorting techniques used as an example.
3.2: You have measured both sorting algorithms efficiency using time benchmarking
technique. Determine other two ways to measure the algorithm efficiency, support
your answer with examples.
3.3: Discuss the performance both behaviours of algorithms in relation to their
implementation, complexity, array sizes, different array shapes, and evaluate the
obtained outcomes against the intended ones.
Use the following code to measure time in java:

Figure 2 : How to measure time of your program in java

Task 4: Adding a delivery feature


You have given the following map of different branches of MacDonalds in your city.
And asked to implement another feature to food delivery service.
Figure 3: MacDonalds Map, b: branch, c: client
4.1: Define what is the closest MacDonalds branch for the delivery man to pick the
order from for each client. Show detailed tracing using bellman ford and Dijkstra's
algorithm shortest path algorithms.
4.2: Critically analyse the complexity of both algorithms in reference to their DS
implementation.

Recommended Resources
Please note that the resources listed are examples for you to use as a starting
point in your research – the list is not definitive.
Textbooks
Learning Outcomes and Assessment Criteria
Pass Merit Distinction
LO1 Examine abstract data types, concrete data
structures and algorithms
P1 Create a design M1 Illustrate, with an D1 Analyse the operation,
specification for data example, a concrete data using illustrations, of two
structures explaining the structure for a First In network shortest path
valid operations that can First out (FIFO) queue. algorithms, providing an
be carried out on the example of each.
structures.
M2 Compare the
P2 Determine the performance of two
operations of a memory sorting algorithms
stack and how it is used
to implement function
calls in a computer.
D2 Discuss the view that
LO2 Specify abstract data types and algorithms in a
imperative ADTs are a basis
formal notation
for object orientation and,
P3 Using an imperative M3 Examine the with justification, state
definition, specify the advantages of whether you agree.
abstract data type for a encapsulation and
software stack. information hiding when
using an ADT
Learning Outcomes and Assessment Criteria
Pass Merit Distinction
LO3 Implement complex data structures and
algorithms
P4 Implement a complex M4 Demonstrate how the D3 Critically evaluate the
ADT and algorithm in an implementation of an complexity of an
executable programming ADT/algorithm solves a implemented
language to solve a well- well-defined problem ADT/algorithm.
defined problem.

P5 Implement error
handling and report test
results
LO4 Assess the effectiveness of data structures and
algorithms
P6 Discuss how M5 Interpret what a
asymptotic analysis can trade-off is when
be used to assess the specifying an ADT using
effectiveness of an an example to support D4 Evaluate three
algorithm. your answer. benefits of using
implementation
independent data
P7 Determine two ways in structures.
which the efficiency of an
algorithm can be
measured, illustrating
your answer with an
example.

You might also like