狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线

COMP2003J代寫、代做Python/Java編程語言

時間:2024-04-17  來源:  作者: 我要糾錯



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". 
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp













 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:CIT 594代做、代寫Python設計編程
  • 下一篇:CS 2550代做、SQL程序語言代寫
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • NBA直播 短信驗證碼平臺 幣安官網下載 歐冠直播 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线
  • <dl id="akume"></dl>
  • <noscript id="akume"><object id="akume"></object></noscript>
  • <nav id="akume"><dl id="akume"></dl></nav>
  • <rt id="akume"></rt>
    <dl id="akume"><acronym id="akume"></acronym></dl><dl id="akume"><xmp id="akume"></xmp></dl>
    日韩久久一级片| 久久国产乱子伦免费精品| 久久美女福利视频| 精品国产一区二区三区无码| 国产欧美精品一二三| 亚洲第一色av| 在线观看中文av| 99999精品| 国产大尺度在线观看| 性鲍视频在线观看| 性欧美18一19内谢| 超碰97在线看| 131美女爱做视频| 国产在线青青草| 美女喷白浆视频| 天天操精品视频| 91成人综合网| 欧美黄色一级片视频| 亚洲欧美激情网| 精品久久免费观看| 国产aaa免费视频| 中文字幕乱码人妻综合二区三区| 超碰影院在线观看| 99亚洲精品视频| 青青青免费在线| 九色porny自拍| 欧美亚洲黄色片| 一区二区在线播放视频| 99九九99九九九99九他书对| 777久久精品一区二区三区无码| 免费无码毛片一区二三区| 欧美 日韩精品| 91xxx视频| 超碰在线97免费| 视色,视色影院,视色影库,视色网| 国产二区视频在线| 色天使在线观看| 日本www在线播放| 超薄肉色丝袜足j调教99| 99精品人妻少妇一区二区| 亚洲男人天堂2021| 成年人网站大全| 国产av麻豆mag剧集| 日日夜夜精品视频免费观看| www.亚洲天堂网| 国产一区二区片| 九九九九九国产| 狠狠热免费视频| 国产淫片免费看| 一本大道东京热无码aⅴ| 日本免费色视频| av视屏在线播放| 日日橹狠狠爱欧美超碰| 18视频在线观看娇喘| 一区二区三区四区毛片| 国产在线青青草| 精品国产免费av| 日韩精品 欧美| 3d动漫一区二区三区| 欧美国产日韩激情| 2021国产视频| 日韩不卡视频一区二区| 亚洲精品中文字幕乱码无线| 亚洲久久中文字幕| 欧美第一页浮力影院| 蜜臀视频一区二区三区| 国产极品尤物在线| 日本少妇高潮喷水视频| 国产精品无码人妻一区二区在线| 少妇一晚三次一区二区三区| 久久av喷吹av高潮av| 免费看黄色a级片| 成人在线视频一区二区三区| 人妻无码一区二区三区四区| 亚洲欧美一二三| 欧美日韩激情四射| 久久综合久久网| 亚洲中文字幕无码专区| 久草精品在线播放| 91日韩视频在线观看| 福利视频999| 污污污污污污www网站免费| 4444亚洲人成无码网在线观看| 日韩美女爱爱视频| 波多野结衣家庭教师视频| 国产欧美一区二| 亚洲国产精品无码观看久久| 国产网站免费在线观看| 狠狠干狠狠操视频| 日韩小视频网站| 男女爽爽爽视频| 欧美黄色免费网址| 日韩毛片在线免费看| 亚洲综合伊人久久| 久久成人免费观看| 奇米视频888| 国产美女在线一区| 日本不卡一区二区在线观看| 国产精品免费看久久久无码| 蜜臀av午夜一区二区三区| 久久久久久久久久一区| 国产黄页在线观看| 伊人五月天婷婷| 国产综合免费视频| 欧美精品一区二区性色a+v| 男女高潮又爽又黄又无遮挡| 26uuu成人| 福利片一区二区三区| 国产玉足脚交久久欧美| 97人人爽人人| 男人搞女人网站| 欧美性久久久久| 成人在线观看www| 成人综合久久网| 激情综合网俺也去| 国产在线播放观看| 国产在线无码精品| www.色就是色.com| 在线观看av日韩| 成人免费无码av| 日韩中文字幕在线视频观看| 永久免费网站视频在线观看| 欧美成人乱码一二三四区免费| 国产高清精品在线观看| 日韩精品免费一区| 中文字幕精品在线播放| 午夜一区二区视频| 午夜精品免费看| 国产精品久久久久久久99| 国产 porn| 视频二区在线播放| 天天干天天爽天天射| 日本女优爱爱视频| 国产三级日本三级在线播放| 中文字幕乱码人妻综合二区三区 | 艳母动漫在线免费观看| 天天干天天玩天天操| 尤物国产在线观看| 天天做天天干天天操| 中文字幕 欧美日韩| 中文字幕 欧美日韩| 波多野结衣激情| 蜜臀av性久久久久蜜臀av| 特级西西人体www高清大胆| 337p亚洲精品色噜噜狠狠p| 国产成年人在线观看| 日本免费a视频| 国产黄色特级片| 国内外成人免费在线视频| av中文字幕网址| 午夜啪啪免费视频| 欧美久久在线观看| www国产精品内射老熟女| 久久久久免费精品| 超碰91在线播放| 国产精品一线二线三线| www.色就是色| 欧美黄网在线观看| 无码精品国产一区二区三区免费| 欧洲熟妇精品视频| 日本xxx免费| 久久久久国产精品熟女影院 | 无码人妻少妇伦在线电影| 97超碰青青草| 中文字幕av久久| 999精品网站| 99久久99久久精品| 国产v亚洲v天堂无码久久久| 在线观看日本www| 免费无码国产v片在线观看| 三年中文在线观看免费大全中国| 免费高清一区二区三区| 国内外成人免费在线视频| 成人av在线不卡| caoporm在线视频| 草草草在线视频| 国产精品一线二线三线| 黄色片免费网址| 国产一伦一伦一伦| 日本午夜激情视频| 美女在线免费视频| 黑森林精品导航| 精品人妻一区二区三区四区在线 | 日本手机在线视频| 美国av在线播放| 污污网站在线观看视频| 欧美色图另类小说| 2018日日夜夜| 欧美 国产 精品| 青少年xxxxx性开放hg| 三上悠亚在线一区| 三级在线视频观看| 污污视频网站免费观看| 亚欧无线一线二线三线区别| 国产 欧美 日韩 一区| 狠狠干视频网站| 国产制服91一区二区三区制服| 日韩精品aaa| 超碰91在线播放| 伊人网在线免费|