国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫I&C SCI 46 、c/c++,Java程序語言代做
代寫I&C SCI 46 、c/c++,Java程序語言代做

時間:2024-11-22  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



I&C SCI 46 Fall 2024 Project 4: Finding Balance in Nature
Due at 9:30 AM. You may use late submissions as usual.
Reviewing related material
I encourage you to review your lecture notes for the Binary Search Tree portions of this class,
especially the portions about balancing trees. The data structure we covered this quarter for a
balanced tree is called a Crumple Tree. Supplemental reading is posted on Canvas.
Very important note: it is not enough to implement some type of binary search tree for this
assignment. For the vast majority of the points, your type must be a Crumple Tree. Attempting
to fool the auto-grader is a decidedly bad idea.
Requirements
In this project you will be implementing the Level-balanced tree data structure as a class named
CrumpleTree. The class consists of the following functions which you are responsible for
implementing and have been started for you in CrumpleTree.hpp:
CrumpleTree()
This is the constructor for the class. You should initialize any variables you add to the
class here.
~CrumpleTree()
This is the class destructor. You are responsible for freeing any allocated memory here.
You will most likely be allocating memory to store the nodes within the tree. Since these
allocations need to be dynamic, as we don’t know how large the tree will be, they should
be freed here in the destructor. It’s your job to come up with a traversal algorithm to
accomplish this. Note, if you elect to use shared pointers or unique pointers the compiler
will generate code to deallocate the memory for you if certain conditions are met. You
should only use these features of the standard library if you already understand them or
are willing to put in extra effort. In most industry settings features like these will be used
as opposed to explicitly implemented destructors.
However, be advised that course staff are not expected to know these and might not be
able to help you debug problems with them. If you are unfamiliar with shared or unique
pointers, use traditional (raw) pointers if you are expecting help with debugging.
[[nodiscard]] size_t size() const noexcept
This function returns the number of keys stored in the tree. It returns the count as a
size_t. It is marked const (also known as a constant member function) because it
should not modify any member variables that you’ve added to the class or call any
function functions that are not marked const as well. The advantage of marking this
function as const is that it can be called on constant CrumpleTree instances. It also
allows the compiler to make additional optimizations since it can assume the object this
function is called on is not changed. This is a fairly good StackOverflow answer that
goes into additional detail.
[[nodiscard]] bool empty() const noexcept
This function simply returns whether or not the tree is empty, or in other words, if the tree
contains zero keys. Marked const because it should not change any member data.
Marked noexcept because it should not throw any exceptions.
bool contains(const K & key) const noexcept
Simply checks to see if the key k is stored in the tree. True if so, false if not. Once
again, this function does not modify any member data, so the function is marked const.
Since this is a balanced tree, this function should run in O(log N) time where N is the
number of keys in the tree. This is accomplished through the on-demand balancing
property of Crumple Trees and a consequence of the height of the tree never exceeding
O(log N). IMPORTANT: when comparing keys, you can only assume that the < and ==
operator has been defined. This means you should not use any other comparison
operators for comparing keys.
std::optional<unsigned> Level(const K & key) const
This returns the level on which the given key is stored in the tree. If the tree does not
contain this key, return std::nullopt.
IMPORTANT: when comparing keys, you can only assume that the < and == operator
has been defined. This means you should not use any other comparison operators for
comparing keys.
Value & find(const K & key)
Like contains(), this function searches for key k in the tree. However, this function
returns a reference to the value stored at this particular key. Since this function is not
marked const, and it does not return a const reference, this value is modifiable through
this interface. This function should also run in O(log N) time since it is bound by the
height of the tree. If the key k is not in the tree, a std::runtime_error should be
thrown.
const Value & find(const K & key) const
Same as the constant version of find, but returns a constant reference to the stored
value, which prevents modification. This function is marked const to present the find
(or “lookup”) interface to instances of CrumpleTree which are marked const
themselves. This means that member data should not be modified in this function. For
example, the following code would call the version of find() marked constant:
CrumpleTree<int, int> tree;
const CrumpleTree<int, int> & treeRef= tree;
treeRef.find(1);
Warning: this function will not be compiled until you explicitly call it on a constant
CrumpleTree as in the example above. If you submit code to GradeScope, and that
system says it does not compile, make sure you've done this. You will end up with a
zero on the assignment if your code does not compile when I pair it with test cases that
call every function. Testing comprehensively is your responsibility!
void insert(const K & key, const V & value)
Adds a (key, value) pair to the tree. If the key already exists in the tree, you may do as
you please (no test cases in the grading script will deal with this situation). The key k
should be used to identify the location where the pair should be stored, as in a normal
binary search tree insertion. Since this is an level-balanced tree, the tree should be
rebalanced if this insertion results in an unbalanced tree.
Note: this is by far the most difficult part of this project.
void remove(const K & key)
Removes the given key from the tree, fixing the balance if needed. If the parameter does
not exist in the tree, do not modify the tree.
I recommend you work on both insert and remove in parts; do not attempt to do the
entire insert, or entire remove, in one session. Test that you are able to get some cases
to pass before moving onto other types of cases.
[[nodiscard]] std::vector<K> inOrder() const
Returns a vector consisting of the keys in the order they would be explored during an
in-order traversal as mentioned in class. Since the traversal is “in-order”, the keys should
be in ascending order.
IMPORTANT: this function, as well as preOrder() and postOrder(), are easy to forget to
test separately. Be very careful with these three, as their value (in terms of test cases
that rely on them) is disproportionately high. Please be absolutely sure you got these
right.
[[nodiscard]] std::vector<K> preOrder() const
Returns a pre-ordering of the tree. For the purpose of this assignment, the left subtree
should be explored before the right subtree.
[[nodiscard]] std::vector<K> postOrder() const
Returns a post-ordering of the tree. For the purpose of this assignment, the left subtree
should be explored before the right subtree.
Additional Notes
● Your implementation must be templated as provided.
○ Be sure yours works for non-numeric types! char is a numeric type.
○ Review the warnings in the lab manual, the grading policies, and in particular the
warning about templated code in the “Grading Environment” section.
● You do not need to write a copy constructor or an assignment operator on this project,
but knowing how to do so is generally a good thing.
● As stated in the contains() function: for comparing keys, use the “natural” comparison
offered by <. You should assume that < and == are defined for any object used for Key.
Any test cases provided will have something for the key that has this defined.
● The project will not build by default because a reference to a local variable is returned in
the find() functions. You will need to write an implementation that doesn’t do this.
Restrictions
Your implementation must be implemented via linked nodes in the tree format from the lecture.
That is, you may not have a “vector-based tree.” This means you will probably need to create a
new structure inside of your CrumpleTree class which will represent the nodes.
You may use smart pointers if you would like to do so. However, course staff are not required to
help you with smart pointers, including debugging code that uses them. I advise students who
are not already familiar with smart pointers to not use them for this project; they're good to
learn, but this is not the project on which to learn them.
You may not use any containers in the C++ standard template library in this assignment except
for std::vector. Furthermore, std::vector may only be used when implementing the
three traversals (in-order, pre-order, post-order). For what it’s worth, you won’t miss it for this
assignment. As always, if there’s an exception that you think is within the spirit of this
assignment, please let me know.
Your implementation does not have to be the most efficient thing ever, but it cannot be “too
slow.” In general, any test case that takes 30 seconds on GradeScope may be deemed a
wrong answer, even if it will later return a correct one. The memory check cases have a
significantly higher timeout period, and are cases which your code will very likely complete (if we
aren't running memcheck on the same code) in milliseconds.
For any assignment in this class, including this one, you may not use the directive using
namespace std; anywhere in your code. Doing so will earn you a zero for the project.
If you are found to be attempting to fool the auto-grader, perhaps by implementing a
different type of balanced binary search tree, this will be treated as a serious case of
academic dishonesty -- it will result in a report to AISC and an F in the class.
In the past, a small subset of students have attempted to contact the inventors of Crumple Trees
to get help on this project. This does not qualify as seeking reasonable help, and there are
plenty of UCI course resources available to you.
Additional Grading Note
This is an additional warning that the public tests are not comprehensive. Remember that the
compiler does not compile functions which are not used. Thus, at the bare minimum you should
add additional unit tests which get all of your code to compile. This has been a problem in the
past; do not ignore that warning. Using different template types will help to make sure you
don’t accidentally bake in assumptions about the type of the Key or Value. Always commit your
unit tests with your code.
The points available for this project are broken down into three categories:
● Basic BST functionality. To have your code tested to earn these points, you must pass
all test cases marked [RequiredBasicFunctionality]. Nothing in this portion requires that
you have a balanced tree, although it is possible that a poor implementation of balancing
could "break" this; please be careful. This portion is worth 1 point
● Crumple Tree functionality. To have your code tested to earn these points, you must
pass all test cases marked [RequiredCrumpleTree]. This portion is worth YY points.
Note that you do not need full CrumpleTree functionality to pass the required cases,
which would allow you to be evaluated on the remaining ones. This is one reason we
recommend you work with cases. This portion is worth 4 points.
○ There may be test cases within this that require only insertion procedure to work
correctly. However, the required case prerequisite requires you to get at least one
delete case to work properly. This is on purpose.
● Memory check. Some of these cases will require some simple functionality to be
reasonably efficient; this is due to a constraint with how long GradeScope will run a
submission. We test with small cases that would run quickly if we were not checking for
memory, and we give a good maximum amount of time for each to run (7-10 minutes
each). This portion is worth 1 point.
Frequently Asked Questions (FAQs)
Q1. Does _____ make problem-solving in this project trivial or is it allowed?
The following parts are permitted for use in this project: std::pair, std::max, std::abs,
std::swap. If you have another part of the standard library in mind, please ask on edStem.
Q2. Are we allowed to include the <functional> library so I can make a lambda function recursive?
Sure, if you think it will help you.
Q3. Can I include parts of the standard library to test my trees?
You can use any library for debugging purposes. The only disallowed functions are for the
final, active submission, submitted to GradeScope.
Q4. Can you use the vectors you got from the in-order, pre-order, or post-order functions in other
functions?
No. You also don't need to. However, you may use std::vector within helper functions of
in/pre/post order traversals.
Q5. Are we allowed to use stacks/queues for the inorder/postorder/preorder functions?
No. You are not allowed to use any standard containers except for in your traversal
implementations where you are allowed only std::vector.
Q6. Are we allowed to use vectors or arrays to store shapes?
No, but I'm sure you could do the same without using an array or vector.
Q7. Are > (greater than) and <= (equal to or greater than) off-limits when comparing keys?
Yes, any other operators other than < (less than) and == (equal to) are off-limits when
comparing keys.
Q8. Can I use recursion to destruct the trees?
You can use recursion for a destructor. However, you should also consider the off chance that
the stack size is exceeded and the destruction fails resulting in unfreed memory.
Q9. What to do if the passed in key does not exist in the remove() function?
You can handle this case as desired; we will not be testing it.
Q10. If the deleted node is not a leaf and has two children, should we replace it with successor or
predecessor?
Both are correct to do, and the grading script will accept either.
Q11. Do we need to have O(log n) time complexity for insert and remove?
That is the target time for balanced binary search trees, including Crumple trees.
Q12. Are we allowed to implement other level-balancing binary search trees on project 4?
No.
Q13. Are we expected to handle very large trees?
Yes, you can assume that the size of the tree will not exceed the maximum uint64_t value.
Q14. Am I permitted to add my new function to the class?
Yes. Also, it doesn’t matter where you make the helper functions as long as you don't change
the public functions and their parameters.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp






 

掃一掃在手機打開當前頁
  • 上一篇:CPT205編程代寫、代做C++/Python語言程序
  • 下一篇:ECE2810J代做、代寫C++語言編程
  • ·&#160;代寫ICT50220、C++/Java程序語言代做
  • ·COMP222代寫、Python, Java程序語言代做
  • ·代寫MISM 6210、Python/java程序語言代做
  • ·代寫DTS203TC、C++,Java程序語言代做
  • ·CS 2210編程代寫、Java程序語言代做
  • 合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁版入口 wps 目錄網(wǎng) 排行網(wǎng)

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

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩精品久久一区二区| 国内视频一区| 国产精品视频在线播放| 精品国产一区二区三区久久久狼| 久久精品综合一区| 久久久久久www| 久久久久久久久久亚洲| 日韩天堂在线视频| 国产精品网站免费| 另类专区欧美制服同性| 国产精品偷伦免费视频观看的 | 97精品视频在线| 成人欧美一区二区三区黑人免费| 国产精品一区二区a| 97欧洲一区二区精品免费| 国产精品69页| 日韩一区二区在线视频| 国产精品日日做人人爱| 欧美激情亚洲激情| 日韩av免费在线| 日韩欧美不卡在线| 国模精品系列视频| 成人免费视频97| 久久精彩视频| 欧美精品免费在线观看| 午夜精品在线观看| 精品日本一区二区三区| 国产精品夜间视频香蕉| 国产不卡av在线免费观看| 久久久精品中文字幕| 一区二区三区四区欧美日韩| 肉大捧一出免费观看网站在线播放| 全黄性性激高免费视频| 国产青草视频在线观看| 国产av天堂无码一区二区三区| 日韩中文字幕亚洲| 中文字幕黄色大片| 欧美日韩视频免费在线观看| 国产精品专区一| 日韩在线视频导航| 久久久久久国产| 日韩欧美亚洲天堂| 国产精品最新在线观看| 久久99精品久久久久久三级 | 精品久久久久久中文字幕动漫| 午夜探花在线观看| 国语精品免费视频| 久久人妻精品白浆国产| 国产精品欧美日韩一区二区| 性一交一乱一伧国产女士spa| 免费黄色福利视频| 国产福利成人在线| 久久综合九色九九| 日本10禁啪啪无遮挡免费一区二区| 国产精品伊人日日| 国产精品久久国产精品| 日韩美女视频中文字幕| 99久久国产综合精品五月天喷水| 国产精品久久久久久影视| 亚洲v欧美v另类v综合v日韩v| 精品视频免费在线播放| 精品国产一区二区在线| 日本婷婷久久久久久久久一区二区| 国产一二三区在线播放| 日韩在线观看高清| 日韩av黄色网址| 97久久国产精品| 欧美激情精品久久久久久黑人| 欧美日韩系列| 日韩一区二区在线视频| 日本香蕉视频在线观看| 国产高清精品一区二区三区| 亚洲中文字幕无码av永久| 精品一区二区不卡| 久久人人爽亚洲精品天堂| 日韩无套无码精品| 久久精品一二三区| 亚洲欧美精品| 国产精品一区二区不卡视频| 国产精品久久久久9999爆乳| 欧美精品久久久| 久久久久天天天天| 日韩极品视频在线观看| 久久久久久久久久久久久国产精品 | 青青在线免费观看视频| 北条麻妃在线视频观看| 欧美精品videofree1080p| 内射国产内射夫妻免费频道| 国产成人无码a区在线观看视频| 日本一级黄视频| 国产成人一区二区三区别| 欧美一级片在线播放| 国产黄色特级片| 日本手机在线视频| 久久久久久久久久久久久久国产| 日本一区二区三区在线视频| 久久久999免费视频| 日本成熟性欧美| 精品国产一区二区三区久久久| 欧美 日韩 国产在线| 久久综合五月天| 国产欧美欧洲| 亚洲一区二区在线看| 99精品国产一区二区| 水蜜桃亚洲一二三四在线| 国产精品91久久| 日韩美女视频中文字幕| 国产精品男人的天堂| 精品视频高清无人区区二区三区| 久久亚洲影音av资源网| 国产乱码精品一区二区三区卡 | 日本不卡一区二区三区视频| 爽爽爽爽爽爽爽成人免费观看| 欧美一级大胆视频| 欧美猛交ⅹxxx乱大交视频| 成人av男人的天堂| 日韩亚洲欧美一区二区| 久久躁狠狠躁夜夜爽| 97国产suv精品一区二区62| 日本视频一区在线观看| 国产精品免费一区二区三区在线观看| 国产日韩一区在线| 色视频一区二区三区| 精品国产网站地址| 丰满少妇大力进入| 青青草原av在线播放| 欧美另类99xxxxx| 久久亚洲精品无码va白人极品| 欧美极品欧美精品欧美| 一区二区视频在线观看| 久久国产精品高清| 国产一区二区免费在线观看| 视频一区二区视频| 欧美成人在线影院| 久久久久久久久久久久av | 国产综合香蕉五月婷在线| 夜夜添无码一区二区三区| www.久久撸.com| 91久久偷偷做嫩草影院| 欧美日韩电影一区二区三区| 欧美精品video| www.国产一区| 99国产在线视频| 黄色片网址在线观看| 欧美一区二区三区免费视| 美女av一区二区| www.国产一区| 国产精品av电影| 国产乱肥老妇国产一区二| 欧美日韩精品免费看| 亚洲欧美日产图| 精品乱色一区二区中文字幕| 色婷婷综合久久久久| 91国产美女视频| 国产免费一区| 黄色一级二级三级| 日韩av日韩在线观看| 一区二区成人国产精品| 麻豆成人在线看| 国产精品网址在线| 色狠狠久久aa北条麻妃| 久久久欧美精品| av动漫在线播放| 国产日产久久高清欧美一区| 欧美精品自拍视频| 欧洲在线视频一区| 日韩亚洲不卡在线| 日韩av免费看网站| 大j8黑人w巨大888a片| 美女999久久久精品视频| 久久精品国产亚洲7777| 国产va亚洲va在线va| 久久久亚洲网站| 国产脚交av在线一区二区| 成人免费观看毛片| 成人在线一区二区| av日韩中文字幕| 91精品视频观看| 777精品视频| 久久综合久久色| 久久久一本精品99久久精品66| 国产精品av在线播放| 国内一区二区在线视频观看| 欧美性猛交久久久乱大交小说| 日本精品视频在线观看| 日韩中文在线字幕| 日韩在线国产| 日韩精品大片| 欧美极品一区二区| 欧美激情视频一区二区三区| 欧美一区二区影视| 麻豆久久久av免费| 国产精选一区二区| 99久久精品免费看国产一区二区三区| 成人精品一区二区三区| 99国产精品久久久久老师| 国产极品尤物在线| 久久久久久久久久国产精品| 久久久国产91| 美女久久久久久久久久久|