爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频

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)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

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

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

    爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频
    <strike id="bfrlb"></strike><form id="bfrlb"><form id="bfrlb"><nobr id="bfrlb"></nobr></form></form>

        <sub id="bfrlb"><listing id="bfrlb"><menuitem id="bfrlb"></menuitem></listing></sub>

          <form id="bfrlb"></form>

            <form id="bfrlb"></form>

              <address id="bfrlb"></address>

              <address id="bfrlb"></address>
              国内精品久久久久久| 亚洲尤物在线| 亚洲午夜一区二区三区| 亚洲你懂的在线视频| 亚洲自拍偷拍福利| 这里只有视频精品| 亚洲一区制服诱惑| 欧美另类videos死尸| 国产精品另类一区| 国产精品伊人日日| 日韩视频在线观看一区二区| 亚洲精品乱码久久久久久蜜桃91| 99re6这里只有精品| 久久躁狠狠躁夜夜爽| 久久精品导航| 国产一区二三区| 日韩一级成人av| 欧美aaa级| 夜夜嗨av一区二区三区网站四季av| 狠狠色丁香婷婷综合影院| 国产精品男人爽免费视频1| 久久综合给合久久狠狠狠97色69| 欧美日韩无遮挡| 欧美亚洲三级| 亚洲国产三级| 欧美黑人多人双交| 在线欧美福利| 亚洲精品在线观看免费| 国产精品国产三级国产aⅴ9色| 亚洲欧美国产三级| 欧美日韩亚洲一区二区| 亚洲成色www8888| 久久精品30| 国产精品毛片在线看| 香蕉av777xxx色综合一区| 欧美另类亚洲| 91久久精品视频| 欧美尤物巨大精品爽| 欧美—级高清免费播放| av成人免费在线观看| 欧美午夜精品久久久久久孕妇| 国产欧美日本在线| 欧美mv日韩mv亚洲| 国产欧美精品xxxx另类| 久久久久久有精品国产| 免费观看在线综合色| 老司机精品导航| 欧美区亚洲区| 亚洲精品在线三区| 亚洲成人在线视频网站| 国产精品久久久久高潮| 欧美日韩三级在线| 国产精品进线69影院| 欧美日韩一区二区在线观看视频| 欧美成人免费在线视频| 国产精品国产三级欧美二区| 免费观看一区| 亚洲一区二区三区四区五区黄| 久久深夜福利| 亚洲最新在线| 亚洲免费高清| 亚洲精品欧美一区二区三区| 国产亚洲视频在线观看| 中文在线资源观看网站视频免费不卡| 欧美日韩午夜在线| 激情综合亚洲| 亚洲欧美国产日韩天堂区| 欧美激情综合亚洲一二区| 久久久另类综合| 国产精品免费区二区三区观看| 一区二区三区四区在线| 亚洲宅男天堂在线观看无病毒| 久久精品国产第一区二区三区最新章节| 国产精品久久久久久久久久妞妞| 久久婷婷久久一区二区三区| 久久精品国内一区二区三区| 欧美一区二区三区婷婷月色| 在线不卡欧美| 国产又爽又黄的激情精品视频| 欧美伦理a级免费电影| 午夜精品视频在线观看| 亚洲综合日本| 黄色成人小视频| 久久―日本道色综合久久| 欧美手机在线视频| 欧美日韩1区2区3区| 亚洲日产国产精品| 国产精品美女久久久久av超清| 黄色成人av网站| 在线观看亚洲精品| 宅男66日本亚洲欧美视频| 国产日韩欧美中文在线播放| 欧美77777| 国产一二三精品| 欧美精品激情blacked18| 99精品视频免费| 欧美一区二区三区在线观看视频| 校园激情久久| 久久精品国产在热久久| 老司机一区二区三区| 亚洲大片在线观看| 欧美在线一二三四区| 欧美一区1区三区3区公司| 国产视频精品免费播放| 亚洲精品视频在线看| 亚洲欧美第一页| 一色屋精品视频在线观看网站| 亚洲欧美日韩在线| 一本色道**综合亚洲精品蜜桃冫| 欧美aaa级| 在线观看日韩av| 欧美淫片网站| 狠狠88综合久久久久综合网| 国产乱码精品| 亚洲第一在线视频| 99视频国产精品免费观看| 久久夜精品va视频免费观看| 国产精品一区二区三区四区五区| 欧美日韩精品在线视频| 亚洲激情电影中文字幕| 尤物精品国产第一福利三区| 欧美精品一区二区三区蜜臀| 1000部精品久久久久久久久| 91久久精品国产| 亚洲欧美日韩高清| 国产人成一区二区三区影院| 国产一区二区久久精品| 国产精品日本| 欧美日韩精品一区二区天天拍小说| 国产欧美在线播放| 亚洲七七久久综合桃花剧情介绍| 欧美日韩网址| 国产精品剧情在线亚洲| 亚洲精品123区| 最新日韩在线视频| 国产一区视频在线看| 亚洲欧美国产精品va在线观看| 亚洲美女区一区| 一本色道久久综合亚洲精品高清| 亚洲高清不卡一区| 久久精品免费| 午夜久久福利| 久久亚洲欧美国产精品乐播| 亚洲成色777777女色窝| 欧美区视频在线观看| 黄色精品一二区| 99精品免费网| 久久国产色av| 亚洲欧美日本另类| 欧美freesex8一10精品| 国产一区二区精品久久| 在线观看国产精品网站| 欧美日韩一二三四五区| 一本一本久久a久久精品综合麻豆| 欧美成人精品在线| 欧美成年人网| 悠悠资源网亚洲青| 亚洲一级片在线观看| 欧美伊人久久久久久午夜久久久久| 一区二区高清视频在线观看| 欧美私人啪啪vps| 久久天天躁狠狠躁夜夜爽蜜月| 亚洲一区影院| 国产亚洲福利社区一区| 老司机成人网| 国产精品扒开腿爽爽爽视频| 久久综合给合久久狠狠狠97色69| 欧美激情亚洲另类| 欧美三区免费完整视频在线观看| 夜夜嗨av一区二区三区网站四季av| 欧美一区二区在线免费观看| 欧美区二区三区| 国产三区二区一区久久| 韩国久久久久| 亚洲女同同性videoxma| 欧美精品成人91久久久久久久| 怡红院av一区二区三区| 国产精品自拍一区| 国产精品久久一区二区三区| 久久国产综合精品| 欧美成人自拍| 久久青草福利网站| 亚洲网站在线看| 欧美国产日韩一区二区在线观看| 国产精品www.| 亚洲一区视频| 91久久精品www人人做人人爽| 欧美日韩伊人| 午夜在线视频观看日韩17c| 久久性天堂网| 久久精精品视频| 91久久嫩草影院一区二区| 麻豆成人精品| 欧美精品亚洲| 亚洲欧洲精品一区二区三区| 久久精品国产清高在天天线| 午夜精品久久久久久久白皮肤| 亚洲精品欧美日韩专区| 久久国产精品免费一区| 久久精品一本久久99精品|