CN5102 Module title Data Structures and Algorithms

SCHOOL OF ARCHITECTURE, COMPUTING &
ENGINEERING
Submission instructions
Cover sheet to be attached to the front of the assignment when submitted
Question paper to be attached to assignment when submitted
All pages to be numbered sequentially
All work has to be presented in a ready to submit state upon arrival at the
ACE Helpdesk. Assignment cover sheets or stationery will NOT be
provided by Helpdesk staff
Module code CN5102 HDU
Module title Data Structures and Algorithms
Module leader Amin Karami
Assignment tutor Amin Karami
Assignment title Coursework
Assignment number 1
Weighting 50%
Handout date 10/12/2018
Submission date 30/01/2019
Learning outcomes
assessed by this
assignment
5, 6, 7, 8, and 9
Turnitin submission
requirement
YES Turnitin GradeMark feedback
used?
NO
UEL Plus Grade Book
submission used?
NO UEL Plus Grade Book
feedback used?
NO
Other electronic
system used?
no Are submissions / feedback
totally electronic?
yes
Additional information
ASSESSMENT FEEDBACK - Feedback on your assessment
will be available in four working weeks from the submission
date. Please refer to the module pages on Moodle for
assessment specific details.
2
Form of assessment:
Individual work Group work
For group work assessment which requires members to submit both individual and
group work aspects for the assignment, the work should be submitted as:
Consolidated single document Separately by each member
Number of assignment copies required:

代做CN5102作业、代做Java实验作业、Java编程作业调试、代写Data Structures作业
1 2 Other
Assignment to be presented in the following format:
On-line submission
Stapled once in the top left-hand corner
Glue bound
Spiral bound
Placed in a A4 ring bound folder (not lever arch)
Note: To students submitting work on A3/A2 boards, work has to be contained
in suitable protective case to ensure any damage to work is avoided.
Soft copy:
CD (to be attached to the work in an envelope or purpose made wallet
adhered to the rear)
USB (to be attached to the work in an envelope or purpose made wallet
adhered to the rear)
Soft copy not required
Note to all students
Assignment cover sheets can be downloaded from logging into UEL Direct via the
following pathway.
UEL Direct → My Record → My Programme → Assessment log dates with Barcoded Front sheet
All work has to be presented in a ready to submit state upon arrival at the ACE Helpdesk.
Assignment cover sheets or stationery (including staplers) will NOT be provided by
Helpdesk staff. This will mean students will not be able to staple cover sheets at the
Helpdesk.
3
Marking Scheme
Topic Total
mark
Remarks
(breakdown of marks for each sub-task)
Linear Data
Structure 50
Develop a Java-based integer calculator through stack, array, and linkedlist
data structures.
Non-Linear
Data Structure
50
(30) Develop a BSTree with Java programming
(6) Binary Tree (BT) Traversal
(4) Considering a Max-Heap Tree in the form of array representation
and inserting a new key
(10) Converting Post-order Traversing to Pre-order Traversing in BST
Good Luck!
4
CN5102 Data Structures and Algorithms - HDU
Assignment 2018-19 Academic Year
1. Design an Integer Calculator by Stack (50 marks)
Your first task is to implement a basic calculator that supports integer operands like 1,
5432, and -35 as well as the (binary) integer operators +, -, *, /, and %. Your task
is to write a Java program that uses stack data structure. The user enters input through
System.in consisting of operands and operators, presumably in postfix (or prefix) notation.
We have also included some extra operators to get information about results and the current
state of the stack:
If the user enters a valid integer, you push that integer onto the stack.
If the user enters a valid operator, you pop two integers off the stack, perform the
requested operation, and push the result back onto the stack.
If the user enters the symbol ? (a question mark), you print the current state of the
stack.
If the user enters the symbol ^ (a caret), you pop the top element off the stack and
print only that element (not the entire stack).
If the user enters the symbol ! (an exclamation mark), you exit the program.
If the user enters string variable (e.g., hi) or 1.5 or anything else that doesn’t
make sense for an integer calculator, your program should stop calculation and print
an error message.
If the user requests an operation for which there are not enough operands on the
stack, your program should notify the user of the problem but leave the stack
unchanged.
Example 1:
(user input):
10 20 30 * + ^ !
(calculator respond):
[]
[10]
[30, 20, 10]
[600, 10]
[610]
610
[]
5
Example 2:
(user input):
1 2 blah 1.0 3
(calculator respond):
#Invalid input.
#Invalid input.
[3, 2, 1]
(user input):
+ +
(calculator respond):
[6]
(user input):
+ +
(calculator respond):
#Not enough arguments.
#Not enough arguments.
[6]
(user input):
!
1- Test your Java program with the above input/output examples.
2- Copy-paste your Java codes into report, clearly with the required comments to
understand your codes.
3- You need to use either array or linked list for stack implementation.
6
2. Non-linear Data Structure (50 marks)
Question 2.1 [Total 30]:
Write a Java program to implement a BSTree as follows:
Get integer or string values from users
Put them into a BSTree
Print the BSTree. This representation should:
o print each node in a separate line
o print null nodes
o print the left subtree before the right subtree
Example:
(1) User input:
S, E, R, X, A, C, H, M
(2) As BSTree format, it looks like:
(3) Your java program must return something like:
-S
|-E
| |-A
| | |-null
| | -C
| | |-null
| | -null
| -R
| |-H
| | |-null
| | -M
| | |-null
| | -null
| -null
-X
|-null
-null
7
Question 2.2 What is the outcome of inorder traversal on this Binary Tree (BT) How
about postorder traversal and preorder traversal? (6 Points)
Question 2.3 Consider the following binary tree representation of a max-heap. (4 Points)
(a) Give the array representation of the heap.
0 1 2 3 4 5 6 7 8 9 10 11 12
- -
(b) Insert the key Q into the binary heap above, circling any entries that changed.
0 1 2 3 4 5 6 7 8 9 10 11 12
-
Question 2.4 What is the 2nd key and 7th key in the pre-order traversal of the below postorder
traversal of a BST? Draw your solution. (10 Points)
Post-order: 5, 6, 15, 10, 23, 24, 22, 26, 20
8
Submission
Each student is required to submit two things:
For programing questions:
o One Eclipse project with all the source codes in a zip file named with the
student id number. Please name the Java programs as requested in each
exercise.
Report: please use the assignment template as a single doc file to all the exercises
accordingly. You can download the template from Moodle. Note: copy and paste
all the source codes into the doc file for those questions asking Java programming.
Turnitin submission: you have to upload two files separately into Turnitin submission
link. To do so, upload your Java codes into Java codes tab, and upload your report into
Report tab.
It is the student responsibility to produce a clear and easily understood document. To do
this:
Check the spelling and grammar in your document.
Use clear, short, and precise language.
Number the pages.
Create a table of contents for your document.
For every figure in your document use a number and a title.
Write references/citations in a standard format.
Explain terms, acronyms, and abbreviations.
Review the document and check for inconsistencies, omissions, redundancies.
Plagiarism
The University defines an assessment offence as any action(s) or behaviour likely to confer an unfair
advantage in assessment, whether by advantaging the alleged offender or disadvantaging
(deliberately or unconsciously) another or others. A number of examples are set out in the
Regulations and these include:
“D.5.7.1 (e) the submission of material (written, visual or oral), originally produced by another
person or persons, without due acknowledgement, so that the work could be assumed the student’s
own. For the purposes of these Regulations, this includes incorporation of significant extracts or
elements taken from the work of (an) other(s), without acknowledgement or reference, and the
submission of work produced in collaboration for an assignment based on the assessment of
individual work. (Such offences are typically described as plagiarism and collusion.)”
The University‘s Assessment Offences Regulations can be found on our web site. Also, information
about plagiarism can be found on the programme’s handbook.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codinghelp

原文地址:https://www.cnblogs.com/rrrrrhelper/p/10327716.html

时间: 2024-10-11 16:14:31

CN5102 Module title Data Structures and Algorithms的相关文章

Data Structures and Algorithms with JavaScript

Book Description As an experienced JavaScript developer moving to server-side programming, you need to implement classic data structures and algorithms associated with conventional object-oriented languages like C# and Java. This practical guide show

Data Structures and Algorithms

Lab 7Data Structures and AlgorithmsProblem 1: Heap1. (3 points) Create a new class Heap This class must implement the following two methods:(a) heapify which takes an array of integers as input and converts it into a max heap.(b) heapsort which takes

Lock-Free Data Structures

By Andrei Alexandrescu, October 01, 2004 Post a Comment Lock-free data structures guarantee the progress of at least one thread when executing mutlithreaded procedures, thereby helping you avoid deadlock. Andrei Alexandrescu is a graduate student in

代写二叉查找树程序作业、代写BST 作业、代写Data Structures

代写二叉查找树程序作业.代写BST 作业.代写Data StructuresKIT205 Data Structures and AlgorithmsAssignment 1: Data StructuresDue: 27th April, 11:55pmIntroductionYou work for an education company that develops and runs Massive Open Online Courses(MOOCs). You have been ask

SE2205: Algorithms and Data Structures for Object-Oriented Design

SE2205: Algorithms and Data Structures for Object-Oriented DesignLab Assignment 1Assigned: Jan 16, 2019; Due: Feb 13, 2019 @ 10:00 a.m.If you are working in a group of two, then indicate the associated student IDsand numbers in the Test.java file as

SE2205: Algorithms and Data Structures

SE2205: Algorithms and Data Structures for Object-Oriented DesignLab Assignment 3Assigned: Mar 20, 2019; Due: April 8, 2019 @ 10:00 a.m.If you are working in a group of two, then indicate the associated student IDsand numbers in the Assignment3.java

Python Tutorial 学习(五)--Data Structures

5. Data Structures 这一章来说说Python的数据结构 5.1. More on Lists 之前的文字里面简单的介绍了一些基本的东西,其中就涉及到了list的一点点的使用.当然,它可不仅仅只有那么一点点,这里给出一个更详细一点的说明.来吧骚连,打开你的命令行窗口 >>>help(list) 看看会出来一些什么~~` list.append(x) 向一个序列里面追加元素 x a = [] a.append(x) # 假设x已经定义了 a[len(a):] = [x] l

Operating system management of address-translation-related data structures and hardware lookasides

An approach is provided in a hypervised computer system where a page table request is at an operating system running in the hypervised computer system. The operating system determines whether the page table request requires the hypervisor to process.

Choose Concurrency-Friendly Data Structures

What is a high-performance data structure? To answer that question, we're used to applying normal considerations like Big-Oh complexity, and memory overhead, locality, and traversal order. All of those apply to both sequential and concurrent software