Data Structures and Algorithms Assig 1 Fall21

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Page 1 of 10

ASSIGNEMNT BRIEF

HTU Course No: 30202200 HTU Course Name: Data Structures & Algorithms

BTEC UNIT No: D/615/1649 BTEC UNIT Name: Data Structures & Algorithms

Version: 1

1
Page 2 of 10

Assignment Brief
Student Name /
ID Number
HTU Course Number and Title 30202200 Data Structures & Algorithms
BTEC Unit Number and Title D/615/1649 Data Structures & Algorithms
Academic Year Fall 2021/2022
Assignment Author Eng. Malek Al-Louzi
Course Tutor Eng. Malek Al-Louzi
Assignment Title Event Management System
Assignment Ref No Assignment 1
Issue Date 16/12/2021
Formative Assessment dates 26/12/2021 – 13/1/2022
Submission Date 27th January 2022
IV Name & Date Dr. Hossam Faris 15/12/2021

Submission Format

The submission of this assignment consists of Three parts:


• An individual written report that has a solution for tasks that ends with the word (Report).
• A full working source codes for tasks that require code implementation, these tasks will end
with the word (Code).
• Discussion with your instructor (and any other witness) about the submitted code.

You need to follow the following guidelines, failing to follow them may result an ‘unclassified’
grade.

Assignment Guidelines
• You are required to submit a well formatted PDF report that provides a complete answer for
all required tasks.
• Full and clear answers for all required tasks, mention the task number and the subtask
number before each answer.
• You should sign the student declaration form attached to this assignment brief (use
electronic signature to sign it).
• You must submit a compressed file (ZIP file) that includes all Source codes for the
tasks that require code implementation, each source code should be named by the task
number and the extension should be .java (TaskN.java). The source file should be fully
commented.
Page 3 of 10

• Soft-copy submissions are only allowed, you are required to upload your submission
files to the university’s eLearning platform through (https://elearning.htu.edu.jo/) within
the submission date and time stated above. NO SUBMISSION by EMAIL and NO
LATE SUBMISSIONS WILL BE ACCEPTED.
• If you commit any kind of plagiarism, HTU policies and regulations will be applied.
• The Discussion will be an online one to one oral discussion between you and your
instructor through Microsoft Teams, which includes debugging, analyzing, and
evaluating the code and algorithm developed in this code.
• The attendance of the oral discussion is mandatory in the date and time determined by
your instructor, the exact discussion schedule will be announced after your submission,
and you need to be ready to open your camera from the beginning of the discussion.
• You must sign the witness form that your instructor will fill up after the discussion to
complete the discussion process.
Page 4 of 10

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.

Assignment Brief and Guidance


Scenario
You are working as a software Engineer in a premier company that develops software solutions
for multiple customers. Your company has accepted to work on a project for developing a
program to help in organizing an event for one of the customers, this program will be named
“Event Management System”, your company assigned you to work in this project, to complete
your work successfully you need to do the following tasks:

Task1
The event place has one main entrance for cars, and it is expected that cars will arrive at the same
time, you should think how to order and organize the expected coming cars from the street that
want to attend the event. The number of attending cars is unknown, so you need to handle this
unknown number of cars too.
Your direct manager in the company suggests organizing the coming cars as the first coming car
will enter to the event first, suppose each car is an integer number, and your direct manager
wants you to use Linked List data structure and wants you to remove the car from the end of the
Linked List.
a. Create a design specification for this data structure showing how to use it for implementing
your solution, also you need to explain the valid operations with this data structure.
(Report)
b. Illustrate how your design will work by showing several cars are coming and leaving based
on a scenario you suggest. (Report)
Task2
In this system, there is an option for the finance department to do some calculations related to the
event, they will input their equations through expressions as the following expression example:

These expressions are in the form of String data type, in this task you will be responsible to
check whether the parentheses in the expression are balanced or not.
The Expression is of the form of a string comprising of constants, variables, operators, and
parentheses, parenthesis include curly brackets, square brackets, and parentheses, as following
Page 5 of 10

You should think of a way to check if parentheses in an expression are balanced or not. Balanced
parentheses are that corresponding to each opening parenthesis we should have a closing
counterpart in correct order.
The following are examples of some expressions:

What’s inside parentheses does not matter you should not check for correctness of anything that
is inside a parenthesis, so in the expression any character other than opening and closing
parenthesis can be ignored.
To solve this problem easily, you need to choose a data structure that you know to use it in your
solution.
a. you should demonstrate how you will solve this problem by writing a Pseudocode for a
function that takes a string expression and returns whether this expression balanced or
not. (Report)
b. You need to specify the ADT of the data structure you used in Task2 a. (Report)
c. Interpret what is a trade-off when specifying this data structure if it exists. (Report)
Task3
A junior colleague of you in your department read that the stack data structure is used to handle
function calls, he asked you to explain how stack is used with function calls. You need to draw a
stack and use it with a scenario that you suggest supporting your answer. (Report)

Task4
This task is for registration department of the event, they need to do the following:
• Register people’s names and ages who are interested to attend the event.
Page 6 of 10

• Check whether a name is registered or not.


• Remove a registered person.
• Print all the registered people in the event.
Your role in this task is to choose and implement a data structure to save the names of people that
want to register for the event and the implementing the above required operations. The data
structure that you want to choose should enable a very fast searching for a name of a person if it
is registered or not. (After taking the advice of your direct manager, he guided you to use a Hash
Map with Closed Addressing (chaining) to avoid collisions).
a. Implement this data structure using java, the user should access this data structure using
four methods only, the functions prototype for these operations are:
• boolean search(string name);
• void insert(string name, int age);
• void remove(string name);
• void print(void);
search returns true if the name exists and false otherwise. insert takes a string as an
argument and adds it to the data structure, remove deletes a name from this data
structure, and print will print all the names and their related ages in this data structure.
(Code)
b. You should handle any expected errors that may occur during the runtime of the
application. (Code)
Task5
Referring to the two famous sorting algorithms, Selection sort and Merge sort, you need to
compare the performance of them by doing the following tasks:
a. Determine two available measurement tools that you can use to measure the
performance of each Algorithm, and briefly explain them, illustrate your answer by an
example. (Report)
b. Evaluate the complexity of each algorithm of the two algorithms. (Report)
c. Compare the performance of these two algorithms and you should show which one is
better and why. (Report)
d. What is asymptotic analysis that you used and how it is used to assess the effectiveness
of any algorithm. (Report)
Task6
In this task, you should find the shortest path to the event location from a near well-known
location, the map around the event location is represented by the following graph, it shows the
well-known location as a vertex named S and the event location as a vertex named F
Page 7 of 10

a. To find the shortest path, you need to apply Dijkstra’s and Bellman-Ford Algorithms to
find the solution using each algorithm, show your steps clearly in each Algorithm.
(Report)
b. Implement the Bellman-Ford algorithm as a method called Bellman in Java, this
method will take Two arguments the Graph and the Source Vertex to start from,
suppose the graph is stored in Adjacency Matrix. Your method should print the shortest
path from the Source Vertex to the destination Vertex only in the graph. (Code)
Task7
After finishing successfully all the previous tasks, your direct manager wants to take your
feedback on the following points to make sure of your understanding to get a promotion in the
company:
a. In reference to the Object-Oriented Programming, what is Encapsulation and what are
the advantages of it when you implement a Data structure, you need to examine these
advantages. (Report)
b. You need to find three benefits of separating the implementation stage of a data
structure and define it as ADT, Evaluate these benefits. (Report)
c. When you define data structures as ADTs, there is an opinion said that this is the basis
of Object-Oriented programming, with justification state whether you agree or not.
(Report)
Page 8 of 10

Learning Outcomes and Assessment Criteria

Pass Merit Distinction

LO1 Examine abstract data types, concrete data structures and algorithms

P1 Create a design specification for data M1 Illustrate, with an example, a D1 Analyse the operation,
structures explaining the valid operations concrete data structure for a First using illustrations, of two
that can be carried out on the In First out (FIFO) queue.
structures. network shortest path
algorithms, providing an
P2 Determine the operations of a memory M2 Compare the performance of
stack and how it is used to implement two sorting algorithms. example of each.
function calls in a computer.

LO2 Specify abstract data types and algorithms in a formal notation


D2 Discuss the view that
P3 Using an imperative definition, specify M3 Examine the advantages of
imperative ADTs are a basis
the abstract data type for a software stack. encapsulation and information
for object orientation and,
hiding when using an ADT.
with justification, state
whether you agree.

LO3 Implement complex data structures and algorithms


D3 Critically evaluate the
P4 Implement a complex ADT and M4 Demonstrate how the
algorithm in an executable programming complexity of an
implementation of an
language to solve a well-defined problem. implemented ADT/algorithm.
ADT/algorithm solves a well-
defined problem.
P5 Implement error handling and report
test results.

LO4 Assess the effectiveness of data structures and algorithms


Page 9 of 10

P6 Discuss how asymptotic analysis M5 Interpret what a trade-off D4 Evaluate three benefits of
can be used to assess the effectiveness is when specifying an ADT using implementation
of an algorithm. using an example to support independent data structures.
your answer.
P7 Determine two ways in which the
efficiency of an algorithm can be
measured, illustrating your answer with
an example.
Page 10 of 10

STUDENT ASSESSMENT SUBMISSION AND


DECLARATION
When submitting evidence for assessment, each student must sign a declaration
confirming that the work is their own.

Student name: Assessor name:

Student ID:

Issue date: Submission date: Submitted on:

/ / / / / /

Programme:

HTU Course Name: Data Structures & Algorithms BTEC UNIT Title: Data Structures
& Algorithms

HTU Course Code: 30202200 BTEC UNIT Code: D/615/1649

I AM REPEATING THIS UNIT*: (YES) (NO)

Plagiarism
Plagiarism is a particular form of cheating. Plagiarism must be avoided at all costs and
students who break the rules, however innocently, may be penalised. It is your
responsibility to ensure that you understand correct referencing practices. As a
university level student, you are expected to use appropriate references throughout and
keep carefully detailed notes of all your sources of materials for material you have used
in your work, including any material downloaded from the Internet. Please consult the
relevant unit lecturer or your course tutor if you need any further advice.

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 signature: Date:

You might also like