久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

COMP2003J代寫(xiě)、代做Python/Java編程語(yǔ)言

時(shí)間:2024-04-17  來(lái)源:  作者: 我要糾錯(cuò)



Assignment 1: AVL & Splay Trees
COMP2003J: Data Structures and Algorithms 2
Weight: 10% of final grade
Document Version: 1.0
Introduction
This assignment is intended to give you experience implementing AVL and
Splay trees. It is also a good exercise to gain experience about how generics,
inheritance and object references work in Java.
Source code that you can start from has been posted to BrightSpace in the file
Assignment1-Source.zip. This also contains the Javadoc API documentation for
the classes that have been provided (in the “doc” folder). Import this project into
Eclipse in the usual way.
Tasks
The main tasks for this assignment are:
• Implement the key methods for an AVL Tree.
• Implement the key methods for a Splay Tree.
• Develop a strategy to test if your implementations are correct.
Implementation of AVL Tree Methods
The source code contains a partial implementation of an AVL Tree in a file
called AVLTree.java in the dsa.impl package. Your work in this section must be
in this class and it must use the interfaces that are provided.
You must implement the following methods:
• public void insert( T value ) – insert a value into the AVL tree.
• public void remove( T value ) – remove a value from the AVL tree.
• public boolean contains(T value) – check to see if a value is contained in
the AVL tree. Returns true if the value is in the tree, or false if not.
• private void restructure( IPosition<T> x ) – trinode restructuring (the three
nodes are x, its parent and its grandparent).
If you wish, you may create other methods that help you to complete the task
(e.g. rightRotate(IPosition<T> n), leftRotate(IPosition<T> n), etc.).
Some hints and tips:
- Remember your AVLTree extends several other classes, so you can
use some of their helpful methods (e.g. expandExternal(…)).
- The expandExternal(…) method uses newPosition(…) to create all
position objects, so all the positions in the tree will be AVLPosition
instances.
- You can cast an IPosition<T> to an AVLPosition in the same way as you
did in previous worksheets.
- Remember every parent/child relationship works in two directions.
Every time you change one of these references, you must change both.
- In the lectures we talk about attaching subtrees. BUT when we program
this, we notice that the subtree structure does not change at all. We just
need to put the root of the subtree in the right place.
- An AVLPosition object has a height attribute. You will need to efficiently
calculate the height of the positions in the tree when the tree changes.
Calculating the heights of all positions every time the tree changes will
be at best O(n). An efficient implementation would be at worst O(h) when
an insert(…) or remove(…) operation is called.
- The TreePrinter class has been provided, so you can print the contents
of your tree and see what it contains.
Implementation of Splay Tree Methods
The source code contains a partial implementation of a Splay Tree in a file
called SplayTree.java in the dsa.impl package. Your work in this section must be
in this class and it must use the interfaces that are provided.
You must implement the following methods:
• private void splay( IPosition<T> p ) – splay a position in the tree.
• public void insert( T value ) – insert a value into the splay tree.
• public void remove( T value ) – remove a value from the splay tree.
• public boolean contains( T value ) – check to see if a value is contained
in the splay tree. Returns true if the value is in the tree, or false if not.
Remember, this method also causes a splay(…) operation.
Testing the Tree Implementations
It is important to check whether your implementations are correct. A good way
to do this is to use your tree to perform some operations, and then check if the
outcome is correct. This is best done using a program, rather than doing it
manually every time.
An example is given in the AVLTreeStructureTest class in the dsa.example
package. This performs some operations (only insert) on an AVL tree. To check
if the final AVL tree is correct, it compares it with a Binary Search Tree that has
the final expected shape (I worked this out manually).
Another example is shown in the AVLTreeSpeedTest class. This performs several
operations on an AVL Tree and measures how quickly it runs. This is a good
way to test the efficiency of your implementation.
Create some test classes for your implementation (called Test1, Test2, etc.).
You can follow these examples or have your own ideas.
In your tests, you should test all the different types of restructuring that are
possible (e.g. for a Splay Tree they should cause zig, zig-zig and zig-zag splays
to both sides, and at the root and deeper in the tree).
Each test class must have a comment to explain the purpose of the test and
what the outcome was.
Submission
• This is an individual programming assignment. Therefore, all code
must be written by yourself. There is some advice below about avoiding
plagiarism in programming assignments.
• All code should be well-formatted and well-commented to describe what
it is trying to do.
• If you write code outside the SplayTree.java, AVLTree.java and test files
(Test1.java, Test2.java, etc.), it will not be noticed when grading. Write
code only in these files.
• Submit a single .zip file to Brightspace.
o This should Include only the files you have written code in. It is
not necessary to submit your entire Eclipse project.
Assignment 1 Grading Rubric
This document shows the grading guidelines for Assignment 1 (implementation of AVL
Trees and Splay Trees). Below are the main criteria that will be applied for the major grades
(A, B, C, etc.). Other aspects will also be taken into account to decide minor grades (i.e.
the difference between B+, B, B-, etc.).
- Readability and organisation of code (including use of appropriate functions,
variable names, helpful comments, etc.).
- Quality of solution (including code efficiency, minor bugs, etc.).
Passing Grades
D Grade
Good implementation of an AVL Tree or Splay Tree, plus some basic testing.
A "good" implementation is one where all the key methods work correctly in the vast
majority of cases (i.e. some occasional bugs will be tolerated).
C Grade
Good implementation of an AVL Tree and a Splay Tree, plus some basic testing of both;
OR
Good implementation of an AVL Tree or a Splay Tree, plus comprehensive testing of the
tree in question.
"Comprehensive" testing should make sure that the different operations of the tree(s) are
all tested (e.g. for a Splay Tree "Zig" operation, it would check both situations where the
node is a left child and where the node is a right child. For a "Zig-Zig" operation, this
should also be tested for both sides, as well as being tested where the splay operation
happens at the root and where it happens deeper in the tree).
B Grade
Excellent implementation of an AVL Tree and a Splay Tree, plus comprehensive testing
of both; OR
Excellent implementation of an AVL Tree and a Splay Tree, with some basic testing and
an efficient approach to height calculation for AVL trees.
A Grade
Excellent implementations of AVL Tree and Splay Tree, with comprehensive testing of
both and an efficient approach to height calculation in AVL Trees.
Failing Grades
ABS/NM Grade
No submission received/no relevant work attempted.
G Grade
Code does not compile; OR
Little or no evidence of meaningful work attempted.
F Grade
Some evidence of work attempted, but few (if any) methods operate in the correct
manner.
E Grade
AVL Tree and/or Splay Tree have been attempted, but there are too many
implementation errors for the implementation to be useful in practice.
Plagiarism in Programming Assignments
• This is an individual assignment, not a group assignment.
• This means that you must submit your own work only.
If you submit somebody else's work and pretend that you wrote it, this
is plagiarism.
• Plagiarism is a very serious academic offence.
Why should you not plagiarise?
• You don't learn anything!
• It is unfair to other students who work hard to write their own solutions.
• It's cheating! There are very serious punishments for students who
plagiarise. The UCD policy on plagiarism can be found online1.
- A student found to have plagiarised can be exclude from their
programme and not allowed to graduate.
Asking for Help
If you find things difficult, help is available.
• TAs are available during lab times.
• You can post questions in the Brightspace discussion forum or our
Wechat group.
• You can email the head TA (dairui.liu@ucdconnect.ie).
• You can get help from your classmates.
**Getting help to understand something is not the same as copying a
solution! **
The best way to get useful answers is to ask good questions.
Don't just send a photo of your computer screen and ask "Why does this not
work?".
Do:
• Send your Java file(s) as an attachment. We can't run code that's in a
photograph to test it out!
• Say what error message you got when you tried to run the code (if
any).
• Say what the code did that you did not expect.
• Say what the code did not do that you did expect.
1 https://www.ucd.ie/t4cms/UCD%20Plagiarism%20Policy%20and%20Procedures.pdf
How to avoid plagiarism: Helping without copying.
If you are trying to help a classmate with a programming assignment, there
are two golden rules:
Never, ever give your code to somebody else.
• You don't know what they will do with it or who they will give it to.
• If somebody else submits code that is the same as yours, you will be
in trouble too.
Don't touch their keyboard (this advice is more relevant when we are in labs together)
• Don't type solutions for them! It will end up looking a lot like your code.
Also, they don't learn anything.
Here are some other ways you can help a friend with an assignment, without
risking plagiarism:
• If their code doesn't work, it's OK to explain what is wrong with it.
• If they don't understand a concept, draw a diagram to explain.
• Tell them about useful methods that I have provided that can help
achieve their goals.
• Describe an algorithm that will help.
• Describe it in words or diagrams, not in code!
• E.g. "You could try saving the node's right child as a variable.
Then you could use a loop to keep getting that node's left child
until you reach the bottom of the tree". 
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp













 

標(biāo)簽:

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:CIT 594代做、代寫(xiě)Python設(shè)計(jì)編程
  • 下一篇:CS 2550代做、SQL程序語(yǔ)言代寫(xiě)
  • 無(wú)相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲(chóng)
    油炸竹蟲(chóng)
    酸筍煮魚(yú)(雞)
    酸筍煮魚(yú)(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚(yú)
    香茅草烤魚(yú)
    檸檬烤魚(yú)
    檸檬烤魚(yú)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗(yàn)證碼平臺(tái) 理財(cái) WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

    亚洲第一中文av| 大肉大捧一进一出好爽动态图| 人妻久久久一区二区三区| www.99在线| 日韩欧美不卡在线| 中文字幕第38页| 国产黄色片免费在线观看| 中文字幕剧情在线观看| 成年人免费在线播放| 国产精品一二三在线观看| 三级视频中文字幕| 国产乱子夫妻xx黑人xyx真爽| 精品91一区二区三区| 免费涩涩18网站入口| 国产极品在线视频| 日韩视频 中文字幕| 亚洲综合激情视频| 国产男女无遮挡| 轻点好疼好大好爽视频| 肉色超薄丝袜脚交| 久久人人爽av| 欧在线一二三四区| 午夜精品久久久久久久无码| 国产成人免费高清视频| 手机免费av片| 亚洲xxxx2d动漫1| 欧美变态另类刺激| 成人免费在线网| 欧美一级爱爱视频| 经典三级在线视频| 亚洲精品中文字幕乱码无线| 亚洲综合日韩欧美| 日韩中文字幕组| 国产性xxxx18免费观看视频| 浮妇高潮喷白浆视频| 热99这里只有精品| 美女扒开大腿让男人桶| 福利在线一区二区| 国产911在线观看| 一级黄色免费在线观看| 欧美一级免费在线| 国产a级片免费看| 国产精品美女在线播放| 亚洲小说欧美另类激情| 国产欧美综合一区| 肉大捧一出免费观看网站在线播放| 91香蕉国产线在线观看| 青春草在线视频免费观看| 99精品一级欧美片免费播放| 亚洲自拍偷拍一区二区三区| 午夜不卡福利视频| 在线成人免费av| 美女黄色片网站| 六月婷婷激情网| 日本一本中文字幕| 国自产拍偷拍精品啪啪一区二区| 免费观看国产精品视频| 18禁免费无码无遮挡不卡网站| 国产l精品国产亚洲区久久| av观看免费在线| 手机在线成人免费视频| 污污的视频免费观看| 国产成人精品免费看在线播放 | 亚洲免费黄色网| aaa一级黄色片| 国产经典久久久| 91动漫在线看| 可以免费观看av毛片| 三上悠亚在线一区二区| 懂色av一区二区三区四区五区| 台湾无码一区二区| 18禁免费无码无遮挡不卡网站| 狠狠操精品视频| 亚洲美女性囗交| 最新视频 - x88av| 久久99中文字幕| www.四虎成人| 亚洲精品免费一区亚洲精品免费精品一区| 欧美 日韩 国产 在线观看| www.av片| 爱爱爱爱免费视频| 久久久久久久久久久久久国产| 欧美深夜福利视频| 三上悠亚av一区二区三区| 欧美美女黄色网| 日本老熟妇毛茸茸| 日本三级中文字幕在线观看| 国内性生活视频| 天天干天天色天天干| 加勒比成人在线| 欧美一级视频在线| 老太脱裤让老头玩ⅹxxxx| 亚洲性图一区二区| 91动漫在线看| 午夜视频在线网站| 亚洲人精品午夜射精日韩| 国产永久免费网站| 国产二区视频在线播放| 色黄视频免费看| 日本精品一区二区三区四区| 欧美 另类 交| 自拍偷拍 国产| 国产av熟女一区二区三区| 五月天亚洲视频| 国产高清av在线播放| 手机在线视频一区| 日本三区在线观看| 日本一级黄视频| 中文字幕 欧美日韩| 成人在线免费观看av| 日韩不卡一二区| 五月天激情视频在线观看| 妞干网视频在线观看| 亚洲精品mv在线观看| 日韩精品一区二区三区色欲av| 男人天堂成人网| 日韩av在线中文| 日韩在线综合网| www.18av.com| 不卡的在线视频| 任你操这里只有精品| 国产精品久久..4399| 天天综合五月天| 天堂在线中文在线| 精品少妇无遮挡毛片| 国产黄页在线观看| 99re6这里有精品热视频| 国产乱码一区二区三区四区| 不卡av免费在线| 日本韩国欧美在线观看| 国产又粗又猛又爽又黄的网站| 欧美日韩久久婷婷| 久热在线视频观看| 亚洲视频在线a| 欧美 日韩 国产一区| 妞干网在线观看视频| 精品人妻大屁股白浆无码| www亚洲国产| 91亚洲一区二区| 日韩av一卡二卡三卡| 欧美一级xxxx| 污污网站免费观看| 波多野结衣xxxx| the porn av| 久久精品午夜福利| 午夜精品久久久内射近拍高清| 可以在线看的av网站| 怡红院av亚洲一区二区三区h| 国产www免费| 国产日韩欧美精品在线观看| 黄色激情在线视频| 中文精品无码中文字幕无码专区| 国产又粗又长又爽视频| 波多野结衣激情| 午夜久久久久久久久久久| 国产一二三四五| 国产a级黄色大片| 国产xxxx振车| 波多野结衣综合网| 欧美黄网站在线观看| 999精品网站| 亚洲最大成人在线观看| 尤物国产在线观看| 亚洲在线观看网站| 最近免费观看高清韩国日本大全| 日韩视频一二三| 东北少妇不带套对白| 国产精品333| 日韩福利视频在线| 亚洲va综合va国产va中文| 国产九九九视频| 欧洲精品视频在线| 国产素人在线观看| 精品久久久久久久无码 | 男人的天堂avav| 国产69精品久久久久久久| 亚洲熟妇国产熟妇肥婆| 免费男同深夜夜行网站| 日本黄大片一区二区三区| 国产高清免费在线| 日本香蕉视频在线观看| 国内精品在线观看视频| 玩弄japan白嫩少妇hd| 亚洲欧美aaa| 久久久天堂国产精品| 精品中文字幕av| 亚洲一级片av| 久久成人福利视频| 乌克兰美女av| 免费在线精品视频| 啊啊啊一区二区| www.久久av.com| 欧美黄网在线观看| 国产男女激情视频| 国产精品12p| 日韩毛片在线免费看| 国产精品久久久久久久av福利| www.av91| 亚洲精品综合在线观看| 久久亚洲精品无码va白人极品|