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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫comp2123、代做Java/C++程序語言
代寫comp2123、代做Java/C++程序語言

時間:2025-03-29  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



comp2123 Assignment 2 s1 2025
This assignment is due on April 8 and should be submitted on Gradescope.
All submitted work must be done individually without consulting someone else’s
solutions in accordance with the University’s “Academic Dishonesty and Plagia rism” policies.
Before you read any further, go to the last page of this document and read
the Written Assignment Guidelines section.
Problem 1. (20 points)
Let T be a binary tree holding n distinct integer keys. A node u ∈ T is said to
be lucky if its key is smaller than its parent’s (if it has a parent) and its children’s
key (if it has any children).
Consider the following algorithm that tries to find a lucky node:
Algorithm 1
1: function FindLucky(T, u)
2: if u.le f t = Null and u.le f t.key < u.key then
3: return FindLucky(T, u.left)
4: if u.right = Null and u.right.key < u.key then
5: return FindLucky(T, u.right)
6: if u.parent = Null and u.parent.key < u.key then
7: return FindLucky(T, u.parent)
8: return u
When the input u is lucky then clearly f indlucky(T, u) returns a lucky node,
namely, u itself. But is it true that for all v ∈ T the function f indlucky(T, v)
always returns a lucky node?
Your task is to
Prove that for all v ∈ T the function f indlucky(T, v) returns a lucky node
or provide a counter example where it fails to return the correct answer.
a)
b) Provide a tight time complexity analysis of the algorithm when T is complete.
Problem 2. (40 points)
Bob Proverra is an apple farmer who maintains an orchard of apple trees. Unfor tunately for Bob, squirrels and birds have begun to infest his trees and eat all the
produce. To make matters worse, a disease has begun to strike some branches
of the trees, meaning they will no longer produce apples in the following year.
Through advanced cameras on the farm, Bob can produce high-quality im ages of the trees, which show him the number of apples on each branch, and
any sightings of squirrels or birds, as well as if any branches are diseased.
Using these images, your task is to design an algorithm to count the number
of apples on each tree and then rank the trees from healthiest to least healthy.
Keep note of the following criteria:
1
comp2123 Assignment 2 s1 2025
• If a branch contains a squirrel, any apples on that branch or higher branches
connected to it should only count for half, since the squirrel may eat some
(this effect compounds if there are more squirrels higher up in the tree).
• If a branch contains a bird, all apples in that tree count for 3
4
, since the bird
may eat some (this effect does not compound).
• The more diseased branches are sighted, the less healthy the tree is rated.
If only part of the branch has visible disease, the rest of the branch is still
considered to be diseased (from the point the disease is visible, until the
leaves of the tree).
Describe an efficient algorithm to count apples in Bob’s orchard, prove the
correctness and analyse the time complexity.
a)
Describe an efficient algorithm to order trees in Bob’s orchard by healthi ness. Note that that the number of apples a tree produced doesn’t affect
its health rating.
b)
Consider if Bob was to prune all of the diseased branches and separate
them from his crop. How would this affect his crop yield? Modify your
algorithm to consider this, giving Bob an idea of how much produce he can
expect to grow in the following year (assuming no new branches grow).
c)
Problem 3. (40 points)
Let T be a binary tree whose nodes store distinct numerical values. Consider the
following pair of operations on binary trees:
• Rotate an arbitrary node upward.
• Swap the left and right subtrees of an arbitrary node.
In both of these operations, some, all, or none of the subtrees A, B, and C
could be empty.
2
comp2123 Assignment 2 s1 2025
Figure 1: rotate 2, rotate 2, swap 3, rotate 3, rotate 4, swap 3, rotate 2, swap 4
Your task is to design an algorithm to transform an arbitrary n-node binary
tree with distinct node values into a binary search tree, using at most O(n
2
)
rotations and swaps.
Your algorithm is not allowed to directly modify parent or child pointers,
create new nodes, or delete old nodes; the only way to modify the tree is through
rotations and swaps.
On the other hand, you may compute anything you like for free, as long as
that computation does not modify the tree; the running time of your algorithm
is defined to be the number of rotations and swaps that it performs.
a) describe your algorithm in plain English,
b) prove it correctness, and
c) analyze its time complexity.
3
comp2123 Assignment 2 s1 2025
Written Assignment Guidelines
• Assignments should be typed and submitted as pdf (no pdf containing text
as images, no handwriting).
• Start by typing your student ID at the top of the first page of your submis sion. Do not type your name.
• Submit only your answers to the questions. Do not copy the questions.
• When asked to give a plain English description, describe your algorithm
as you would to a friend over the phone, such that you completely and
unambiguously describe your algorithm, including all the important (i.e.,
non-trivial) details. It often helps to give a very short (1-2 sentence) de scription of the overall idea, then to describe each step in detail. At the end
you can also include pseudocode, but this is optional.
• In particular, when designing an algorithm or data structure, it might help
you (and us) if you briefly describe your general idea, and after that you
might want to develop and elaborate on details. If we don’t see/under stand your general idea, we cannot give you marks for it.
• Be careful with giving multiple or alternative answers. If you give multiple
answers, then we will give you marks only for "your worst answer", as this
indicates how well you understood the question.
• Some of the questions are very easy (with the help of the slides or book).
You can use the material presented in the lecture or book without proving
it. You do not need to write more than necessary (see comment above).
• When giving answers to questions, always prove/explain/motivate your
answers.
• When giving an algorithm as an answer, the algorithm does not have to be
given as (pseudo-)code.
• If you do give (pseudo-)code, then you still have to explain your code and
your ideas in plain English.
• Unless otherwise stated, we always ask about worst-case analysis, worst case running times, etc.
• As done in the lecture, and as it is typical for an algorithms course, we
are interested in the most efficient algorithms and data structures, though
slower solutions may receive partial marks.
• If you use further resources (books, scientific papers, the internet,...) to
formulate your answers, then add references to your sources and explain it
in your own words. Only citing a source doesn’t show your understanding
and will thus get you very few (if any) marks. Copying from any source
without reference is considered plagiarism.
4

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

掃一掃在手機打開當前頁
  • 上一篇:comp2123代做、代寫c/c++,Python設計編程
  • 下一篇:菜鳥錢包強制下款怎么辦?如何聯系菜鳥錢包客服電話解決問題?
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

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

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产精品主播视频| 国产成人一区二区三区| 国产经典一区二区| 久久成人人人人精品欧| 日韩少妇内射免费播放| 国产精国产精品| 亚洲色成人一区二区三区小说| 国产日本欧美一区二区三区| 国产精品久久久对白| 欧美成人蜜桃| 国产精品久久久久一区二区| 日韩欧美一区二| 久久亚洲国产成人精品无码区| 在线一区日本视频| 国产精品自拍小视频| 欧美日韩福利在线观看| 国产三级精品在线不卡| 国产精品国产三级国产aⅴ9色| 僵尸世界大战2 在线播放| 色久欧美在线视频观看| 青青青在线播放| 久久精品国产欧美激情| 欧美日韩在线播放一区二区| 久久久精品免费视频| 欧美日韩一区二| 国产精品欧美日韩久久| 青青青在线视频播放| 日韩中文字幕国产精品| 欧美专区中文字幕| 久久精品中文字幕| 麻豆成人小视频| 国产99久久精品一区二区| 白嫩少妇丰满一区二区 | 欧美激情一二区| 国产精品直播网红| 亚洲欧洲日韩精品| 国产高清精品一区二区三区| 奇米四色中文综合久久| 国产精品色悠悠| 国产日韩欧美91| 欧美激情亚洲激情| 97久久精品国产| 日韩欧美不卡在线| 国产精品久久久久久久久借妻| 国产在线观看精品| 亚洲精品中字| 久久久国产成人精品| 国产午夜伦鲁鲁| 性色av一区二区咪爱| 久久久国产一区二区三区| 国产欧美一区二区三区视频| 都市激情久久久久久久久久久 | 日韩欧美一区二区三区久久婷婷 | 性欧美大战久久久久久久| 日韩一区视频在线| 国产欧美精品xxxx另类| 日本在线播放一区| 国产精品欧美一区二区| 官网99热精品| 日韩精品无码一区二区三区免费| 国产精品对白一区二区三区| 国产精品一区二区三区在线播放| 色综合影院在线观看| 国产精品男女猛烈高潮激情| 成人国产精品一区二区| 日韩videos| 久久综合国产精品台湾中文娱乐网| 91精品国产91久久久久麻豆 主演| 欧美专区在线播放| 亚洲一区二区中文| 国产精品丝袜高跟| 国产精品1区2区在线观看| 免费看a级黄色片| 亚洲精品电影在线一区| 国产精品久久久亚洲| 久久五月天婷婷| 精品一区在线播放| 天天干天天色天天爽| 久久在线精品视频| 久久久久久久久久久99| 国产精品主播视频| 欧美性视频在线| 亚洲免费精品视频| 久久夜色精品国产| 久久精品国产精品青草色艺| 精品视频一区二区三区四区| 日本精品福利视频| 欧美激情综合色| 国产精品区一区二区三在线播放| 国产精品444| 成人欧美一区二区三区黑人| 青青草免费在线视频观看| 亚洲午夜精品一区二区三区| 国产精品免费小视频| 久久精品ww人人做人人爽| 国产精品一区二区久久精品| 茄子视频成人免费观看| 水蜜桃亚洲一二三四在线| 中文字幕精品在线播放| 国产精品激情av电影在线观看| 久久久久久久一区二区| 国产福利一区视频| 114国产精品久久免费观看| 国产精品一区二区三区免费视频| 国内自拍中文字幕| 欧美综合一区第一页| 五月天在线免费视频| 夜夜添无码一区二区三区| 蜜臀久久99精品久久久无需会员| 国产精品手机视频| 色妞在线综合亚洲欧美| 久久99导航| 国产成人av网| 国产妇女馒头高清泬20p多| 国产精品99久久久久久久久久久久 | 国产成人久久婷婷精品流白浆| 久久久伊人日本| 97免费在线视频| 成人免费淫片aa视频免费| 国产伦精品一区二区| 国产乱码一区| 成人在线免费观看一区| 成人av影视在线| www.日本少妇| 91国自产精品中文字幕亚洲| 91国产中文字幕| 国产精华一区二区三区| 国产成人亚洲综合无码| 久久99精品久久久久久久青青日本 | 一区二区三区免费看| 精品自拍视频在线观看| 欧美日韩成人在线播放| 亚洲最大av网| 日韩中文字幕在线视频观看| 日韩av第一页| 欧美中文在线视频| 精品欧美一区二区久久久伦| 精品一区二区国产| 国产专区欧美专区| 国产精品夜夜夜一区二区三区尤| 成人国产精品av| 国产精品12p| 日韩综合中文字幕| 国产精品久久色| 中文字幕欧美日韩一区二区| 亚洲欧美日韩不卡| 日韩videos| 男女超爽视频免费播放| 国产在线播放一区二区| 成人免费aaa| 久久久久久国产精品mv| www亚洲欧美| 精品福利影视| 亚洲日本精品一区| 日韩视频精品| 国产无限制自拍| 国产精品69久久| 国产成人生活片| 免费99精品国产自在在线| 天天人人精品| 韩国v欧美v日本v亚洲| www.av蜜桃| 久久精品视频在线| 亚洲自拍中文字幕| 青青久久av北条麻妃黑人| 国产一区免费视频| 68精品久久久久久欧美| 免费在线国产精品| 成人精品在线观看| 日韩在线观看高清| 一区二区三区四区免费视频| 日本精品一区| 国产欧美最新羞羞视频在线观看| 国产经典久久久| 久久亚洲国产成人| 视频一区二区综合| 麻豆av免费在线| 久久精品.com| 最新国产精品久久| 欧美亚洲黄色片| 91免费视频国产| 国产精品成人一区二区三区吃奶| 五码日韩精品一区二区三区视频 | 国产精品久久久久久久app| 亚洲资源视频| 麻豆av一区| 国产激情综合五月久久| 米奇精品一区二区三区在线观看| 热久久这里只有精品| 91精品啪在线观看麻豆免费| 国产精品福利网| 日韩久久不卡| y111111国产精品久久婷婷| 国产精品免费久久久| 日本一区二区免费高清视频| 福利精品视频| 久久伊人精品天天| 欧美性大战久久久久xxx| 久久久之久亚州精品露出| 欧美极品第一页|