成a人片国产精品_色悠悠久久综合_国产精品美女久久久久久2018_日韩精品一区二区三区中文精品_欧美亚洲国产一区在线观看网站_中文字幕一区在线_粉嫩一区二区三区在线看_国产亚洲欧洲997久久综合_不卡一区在线观看_亚洲欧美在线aaa_久久99精品国产_欧美卡1卡2卡_国产精品你懂的_日韩精品91亚洲二区在线观看_国内一区二区视频_91丨国产丨九色丨pron

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人片国产精品_色悠悠久久综合_国产精品美女久久久久久2018_日韩精品一区二区三区中文精品_欧美亚洲国产一区在线观看网站_中文字幕一区在线_粉嫩一区二区三区在线看_国产亚洲欧洲997久久综合_不卡一区在线观看_亚洲欧美在线aaa_久久99精品国产_欧美卡1卡2卡_国产精品你懂的_日韩精品91亚洲二区在线观看_国内一区二区视频_91丨国产丨九色丨pron
    成人妖精视频yjsp地址| eeuss影院一区二区三区| 免费成人你懂的| 99精品视频一区二区三区| 欧美大片国产精品| 亚洲一区精品在线| 北条麻妃国产九九精品视频| 欧美电视剧在线看免费| 五月婷婷综合激情| 在线观看日韩电影| 中文成人av在线| 精品一区二区三区日韩| 欧美男男青年gay1069videost | 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 成人激情小说网站| 欧美成人a视频| 视频一区二区三区在线| 在线观看区一区二| 亚洲色图一区二区三区| 国产69精品一区二区亚洲孕妇| 日韩美女在线视频| 日韩中文字幕av电影| 欧美性色aⅴ视频一区日韩精品| 日韩理论在线观看| 99re这里只有精品视频首页| 国产精品天天看| 豆国产96在线|亚洲| 精品久久久网站| 九色porny丨国产精品| 欧美老女人在线| 午夜一区二区三区视频| 欧美中文字幕一区| 亚洲国产精品综合小说图片区| 色哟哟日韩精品| 欧美天堂一区二区三区| 一区二区三区中文在线| 日本道色综合久久| 亚洲午夜精品网| 在线亚洲一区观看| 亚洲综合一区二区三区| 91国偷自产一区二区三区观看| 一区二区三区不卡在线观看 | 国产.欧美.日韩| 久久精品一级爱片| 国产精品一二三在| 欧美国产欧美综合| 不卡视频一二三四| 综合在线观看色| 在线视频综合导航| 婷婷久久综合九色国产成人| 91麻豆精品国产无毒不卡在线观看 | 亚洲一卡二卡三卡四卡无卡久久 | 8x8x8国产精品| 美腿丝袜一区二区三区| 2023国产一二三区日本精品2022| 国产最新精品免费| 欧美激情一区二区三区| 97aⅴ精品视频一二三区| 一区二区三区精品久久久| 欧美巨大另类极品videosbest | 成人小视频免费在线观看| 国产精品国产三级国产aⅴ入口| 97久久久精品综合88久久| 亚洲精品国久久99热| 欧美三日本三级三级在线播放| 日韩精品一二三四| 精品福利在线导航| 成人禁用看黄a在线| 一区二区三区四区在线| 欧美精选午夜久久久乱码6080| 蓝色福利精品导航| 亚洲国产精品ⅴa在线观看| 色欧美乱欧美15图片| 午夜一区二区三区视频| 26uuu另类欧美亚洲曰本| 99re这里都是精品| 人人爽香蕉精品| 国产精品三级av在线播放| 91高清视频在线| 老司机免费视频一区二区| 国产精品久久久久三级| 欧美美女一区二区三区| 国产成人精品一区二| 一区二区三区不卡视频| 日韩女优制服丝袜电影| 99久久国产综合精品色伊| 日韩精品一二三区| 欧美国产精品一区二区| 欧美日韩大陆一区二区| 高清在线观看日韩| 午夜国产不卡在线观看视频| 国产欧美精品国产国产专区| 欧美日韩aaaaaa| 成人午夜电影网站| 首页欧美精品中文字幕| 亚洲国产成人在线| 欧美一区在线视频| 97久久人人超碰| 另类小说综合欧美亚洲| 亚洲精品成人在线| 久久久久国产精品麻豆| 欧美美女直播网站| 成人av网站免费观看| 老司机精品视频导航| 亚洲靠逼com| 久久久国产综合精品女国产盗摄| 在线观看日韩高清av| 国产成人鲁色资源国产91色综| 婷婷综合久久一区二区三区| 国产精品激情偷乱一区二区∴| 日韩欧美在线1卡| 在线视频欧美精品| 国产盗摄一区二区| 日韩经典一区二区| 国产精品福利一区| 精品国产人成亚洲区| 欧美调教femdomvk| 不卡一区二区在线| 国产自产2019最新不卡| 日日摸夜夜添夜夜添精品视频| 亚洲欧美在线高清| 久久精品免视看| 欧美成人艳星乳罩| 欧美婷婷六月丁香综合色| 成人不卡免费av| 国产在线精品一区二区三区不卡| 亚洲国产sm捆绑调教视频| 欧美激情在线看| 久久综合视频网| 69堂国产成人免费视频| 欧美亚洲国产bt| 97久久精品人人澡人人爽| 国产.欧美.日韩| 国产乱人伦偷精品视频免下载| 蜜臀久久99精品久久久久久9 | 黄网站免费久久| 午夜精品一区二区三区三上悠亚| 亚洲欧美成人一区二区三区| 国产精品丝袜91| 国产亚洲精品中文字幕| 日韩一二三区视频| 欧美日韩成人在线| 欧美在线你懂的| 成人国产免费视频| 国产精品影音先锋| 久久精品99国产精品| 亚洲大片精品永久免费| 亚洲黄色av一区| 亚洲欧美日韩一区二区 | 亚洲美女在线国产| 国产亚洲一二三区| 欧美电影免费观看高清完整版在线 | 成人免费视频caoporn| 久久99九九99精品| 性久久久久久久| 亚洲韩国一区二区三区| 一区二区在线观看视频在线观看| 中文字幕色av一区二区三区| 欧美国产日本视频| 国产欧美久久久精品影院| 欧美激情资源网| 国产成人av电影在线| 国产精品一卡二卡在线观看| 精品一区二区久久久| 国内精品嫩模私拍在线| 国产一区二区看久久| 国产高清在线观看免费不卡| 国产精品1区2区| 国产传媒久久文化传媒| 成人午夜在线播放| 成人app软件下载大全免费| 99久久精品情趣| 色综合久久九月婷婷色综合| 色av成人天堂桃色av| 在线亚洲精品福利网址导航| 欧美日韩视频在线第一区| 欧美日韩中文字幕一区| 欧美人伦禁忌dvd放荡欲情| 欧美精品99久久久**| 91麻豆精品国产91久久久| 8v天堂国产在线一区二区| 欧美一卡二卡在线| 欧美xxxxx牲另类人与| 亚洲图片自拍偷拍| 亚洲欧美另类在线| 亚洲精品视频在线观看网站| 亚洲影视在线观看| 偷拍一区二区三区四区| 日本欧美一区二区三区| 激情六月婷婷久久| 国产成人鲁色资源国产91色综| 99视频热这里只有精品免费| 91久久精品一区二区二区| 欧美优质美女网站| 制服丝袜一区二区三区| 精品伦理精品一区| 中日韩av电影| 亚洲在线中文字幕| 亚洲成av人片一区二区梦乃| 婷婷一区二区三区|