首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写program、代做Java程序语言
项目预算:
开发周期:
发布时间:
要求地区:
Algorithms and Data Structures (M)
Assessed Coursework
This coursework is worth a total of 30 marks and contributes 20% towards the course credit.
This coursework should take between 6 and 8 hours to complete. It is divided into two parts:
1.Exercise in using the Java Map interface and in using a Map implementation (namely, HashMap). Note that we do not study the Map ADT until the end of the course. The purpose
of this exercise is not to know how a hashmap is implemented, rather how to use it. That is, to demonstrate that you understand how to use Java interfaces and implementation classes (from your experience with other ADTs, and the examples using interfaces and implementations, like those from the introduction slides seen in Lecture 1).
2.Implementation of a Graph ADT. Note that graphs are covered in various textbooks but
don’t be tempted to use any implementation you see in them. This question is very specific, and you must follow the instructions completely. You will submit your code for testing together with a description document. In your description document you should provide outline code containing method signatures and detailed comments explaining how your methods work, what underlying (array) algorithms you would use and the complexity of each of the algorithms used. Most of the marks will be awarded for your description.
Submit all required parts of your solutions to both parts of the assignment (see full submission details near the end of this document). All classes and pdf documents should contain your name and student number. You should submit your coursework by Monday
March 18th at 4.30 pm.
1.[5 marks]
This part of the exercise is to show that you understand the Java interface Map and how to use one of its implementations, HashMap.
You have been provided with an outline of a class, AssE1_outline.java. You should make a copy of AssE1_outline.java and rename it AssE1.java.
ADS Assessed Coursework 2024 1
Complete the AssE1.java class as instructed in the comments within the file (address issues 1-8). Do not include any package declaration. You should include any import statements necessary for me to run the program from the command line thus:
javac AssE1.java
java AssE1 readersAndBooks1.txt readersAndBooks2.txt
You may add helper methods if you need to, but any unnecessary complexity (of code) will be penalized. Note that your program should still run if I replace the arguments in the above with other similar files (containing lines of pairs of strings), but text files readersAndBooks1.txt and readersAndBooks2.txt have been provided for illustration and to help you test your class.
When you are happy with your class, run it and store the output in a pdf document called AssE1_output.pdf (remove any additional print statements you may have added to your methods for testing purposes first). You should include your name and student number at the top of this document.
Full submission instructions will be included at the end of this document, but for this part of the exercise you will submit your two files: AssE1.java and AssE1_output.pdf.
2.[25 marks] A graph is an abstract data type (ADT) which consists of a set of labelled points, or vertices and a set of pairs of vertices, called edges. For any edge (vi, vj), the label of vertex vi is smaller than the label of vertex vj.
For example, the first graph (i) in Fig. 1 has vertices which are labelled using characters ‘a’, ‘b’, ‘c’, ‘d’ and ‘f’. The vertex set is {v1, v2, v3, v4, v5} and the edge set is {e1, e2, e3, e4} where e1 is (v1, v2), e2 is (v2, v3), e3 is (v2, v4) and e4 is (v4, v5). Graph (ii) is the result of adding a new vertex and a new edge. Graph (iii) is the result of an attempt to add a new vertex with a label identical to that of an existing vertex, and graph (iv) is the result of deleting a vertex. Note that if a vertex is deleted, all edges associated with that vertex are deleted.
ADS Assessed Coursework 2024 2
Figure 1: Example graphs and operations
Note that it is not possible to:
-add a new vertex to a graph whose label is the same as that for a vertex already in the graph,
-remove a vertex v that is not in the graph (even if the graph contains a vertex with the same label as v),
-add an edge between vertices that have not been added to the graph,
-add an edge if it already exists in the graph,
-remove an edge that is not in the graph.
Box 1 contains a Java interface for a simplified graph, Graph (whose vertices can have labels of any comparable type F). The interface refers to classes Vertex
and Edge
which define a vertex of type F and an edge of type F respectively. Note that if e=(v1,v2) we say that e contains v1 and v2.
ADS Assessed Coursework 2024 3
public interface Graph
>
{ public boolean addEdge (Edge
e);
//add edge e to graph if its vertices are already in graph
//and e doesn’t already exist in graph
//return true if successful and false otherwise
public boolean addVertex (Vertex
v);
//Add vertex v to graph if graph doesn’t already contain v
//or any vertex with the same label as v
//return true if successful and false otherwise
public boolean deleteEdge (Edge
e);
//delete edge e if it is present in graph
//return true if successful and false otherwise
public boolean deleteVertex (Vertex
v);
//delete vertex v if it is present in graph, and all edges that contain v
//return true if successful and false otherwise.
public Set
> vertexSet();
//return a set containing all vertices
public Set
> edgeSet();
//return a set containing all edges
}
Box 1: Graph interface
Implement the Graph interface as a class ArrayGraph.java whose instance variables consist of:
-two arrays: vertices and edges, of type Vertex
and Edge
respectively containing the current vertices and edges in the graph, each array sorted in ascending order, and
-two integer variables representing the current numbers of vertices and edges.
Note that you must also implement (generic) Vertex and Edge classes, and you must decide for yourself exactly how vertices and edges should be compared (and thus ordered). This information should be included in your description document, which is described below.
You may assume that any instantiation of your class has at most 20 vertices and at most 50 edges at any time.
You will be submitting your full Java code, which I will run using a test program like
ADS Assessed Coursework 2024 4
the one provided – TestGraph.java. I will not be looking at your code in detail other than for this testing stage, although I may look closer to determine why it doesn’t run. You must ensure that your program runs with the provided test class (e.g., ensure that your classes contain the necessary constructors).
In addition to your code, you should include a pdf document graphDescription.pdf, describing your implementation. This document should not contain large amounts of code (although you may find that it helps to provide fragments, and you should include important parts of your code, such as your class signatures and instance variables), it is your description that is important. You also do not need to provide full implementations of the Vertex and Edge classes within the document but should indicate their instance variables and the signatures of any methods within those classes that you refer to in your description. If you require any helper methods, give the signatures (and a commented description) of each method in your document, but you should not include the full implementation. Note that if you program does not work, include details of why you believe it does not in this document.
For each of the Graph methods, analyse the time complexity of the underlying (array) algorithms used (and state what these underlying algorithms are).
Summary: Provide full code plus description document containing outline code with detailed, clear comments, and complexity analysis of your implementation of the Graph methods.
Submission instructions:
You should submit a single zipped folder named xxxxxxxx.zip where xxxxxxxx is replaced with your student id (e.g. 0123456a). The folder should contain two subfolders: AEx1 and AEx2 containing your solutions for parts 1 and 2.
AEx1 will contain two files: AssE1.java, and AssE1_output.pdf only.
AEx2 will contain four files: Vertex.java, Edge.java, ArrayGraph.java, and graphDescription.pdf only.
Marking scheme:
1.program runs as expected and output provided: 5 marks.
2.Vertex.java, Edge.java, ArrayGraph.java work with test class: 5 marks. Class signatures : 4 marks.
Node and Edge descriptions: 6 marks.
graphDescription:
Descriptions of Graph methods (including descriptions of any helper methods): 6 marks.
Complexity analysis of Graph: 4 marks.
ADS Assessed Coursework 2024 5
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!