国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女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怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久久久中文字幕2018| 国产一级大片免费看| 日本一区二区三区视频在线观看| 免费观看亚洲视频| 久久久久久久成人| 亚洲一区二区在线免费观看| 黄色网络在线观看| 久久久久久久久国产精品| 性日韩欧美在线视频| 91精品国产高清久久久久久91| 久久香蕉频线观| 精品人妻人人做人人爽| 久草一区二区| 日韩一级片免费视频| 国模杨依粉嫩蝴蝶150p| 国产精品欧美日韩| 国内视频一区| 国产精品日韩欧美| 欧美精品无码一区二区三区| 久久精品99无色码中文字幕| 日韩精品第1页| 久久精品国产第一区二区三区最新章节| 亚洲影影院av| 97国产精品久久| 亚洲欧洲另类精品久久综合| 草莓视频一区| 亚洲精品一区国产精品| av观看免费在线| 久久99视频精品| 精品一区二区三区自拍图片区| 国产精品日韩电影| 国产这里只有精品| 中国成人亚色综合网站| 91精品视频在线播放| 亚洲一区 在线播放| 91精品久久久久久久久久久久久久| 国产综合av一区二区三区| 欧美精品日韩www.p站| 国产日韩在线精品av| 亚洲午夜高清视频| 91精品国产高清久久久久久91裸体| 亚洲色成人www永久在线观看| 91九色偷拍| 日本午夜精品一区二区| 91精品国产综合久久香蕉| 日本久久高清视频| 久久精品99国产精品酒店日本| 男人天堂新网址| 久久久久久国产精品三级玉女聊斋| 99久久99久久精品| 日本精品久久电影| 国产精品久久国产精品99gif | 人妻有码中文字幕| zzjj国产精品一区二区| 精品视频一区在线| 曰韩不卡视频| 日本丰满少妇黄大片在线观看| 国产精品天天av精麻传媒| 国产亚洲欧美在线视频| 亚洲天堂av免费在线观看| 久久99精品久久久水蜜桃| 精品视频一区在线| 亚洲国产精品视频一区| 精品国产一区二区三区四区在线观看| 欧美日韩免费高清| 精品国偷自产一区二区三区| 成人av中文| 日韩精品 欧美| 精品不卡一区二区三区| 国产成人精品久久久| 精品一区二区视频| 亚洲最新在线| 久久精品国产一区二区电影| 国产乱肥老妇国产一区二| 色综合久久av| 精品国产乱码久久久久久蜜柚| 91av在线不卡| 国产中文字幕亚洲| 色999五月色| 国产精品免费观看在线| 97国产在线观看| 精品网站在线看| 日本中文字幕一级片| 国产精品久久久久久久久久三级| 91精品视频观看| 极品日韩久久| 亚洲一区不卡在线| 国产精品久久久久国产a级| 91精品国产高清久久久久久91| 精品www久久久久奶水| 亚洲综合最新在线| 91久久精品在线| 精品日本一区二区三区 | 国产一区二区视频在线观看| 污污污污污污www网站免费| 国产精品精品国产| 久久久久久伊人| 北条麻妃在线视频观看| 男女视频一区二区三区| 亚洲一区在线直播| 国产精品美女诱惑| 国产精品91久久久| 国产奶头好大揉着好爽视频| 欧美亚洲伦理www| 肉大捧一出免费观看网站在线播放| 国产精品激情自拍| 久久久久这里只有精品| 性欧美大战久久久久久久| 精品久久一区二区三区蜜桃| xxx一区二区| 国产激情视频一区| www国产亚洲精品| 国产日韩二区| 狠狠色噜噜狠狠色综合久| 日韩av电影中文字幕| 精品国产无码在线| 国产精品久久久久9999| 国产精品视频xxxx| www.欧美免费| 久久久久久久久久码影片| 国产成人精品免高潮费视频| 91精品国产综合久久香蕉的用户体验| 国产欧美高清在线| 国产日韩精品入口| 国产日产欧美精品| 国产欧美日韩在线播放| 国产免费一区二区三区在线观看| 国产专区精品视频| 国产在线拍揄自揄视频不卡99| 国内视频一区| 欧美中文在线视频| 欧洲精品视频在线| 欧美不卡福利| 欧美久久久久久一卡四| 欧美福利精品| 精品无人区一区二区三区| 国产一区不卡在线观看| 国产一区红桃视频| 精品999在线观看| 国产亚洲精品网站| 国产精品一区电影| 69av在线播放| 久久久久免费精品国产| 久久精品国产久精国产思思| 国产精品久久精品视| 国产精品久久一区二区三区| 国产精品久久久久久久久久| 九九热这里只有精品免费看| 一本久道中文无码字幕av| 亚洲黄色一区二区三区| 日本免费在线精品| 男人添女人下部视频免费| 国产日韩在线观看av| www国产免费| 国产成人在线一区二区| 日韩午夜在线视频| 欧美成人午夜剧场免费观看| 亚洲色欲综合一区二区三区| 欧美一级片免费观看| 欧美牲交a欧美牲交aⅴ免费下载| 欧美在线3区| 国产啪精品视频| 久久综合九色综合88i| 精品国产美女在线| 久久91精品国产| 日本中文字幕在线视频观看| 欧美国产综合在线| 草b视频在线观看| 日韩视频免费中文字幕| 萌白酱国产一区二区| 午夜精品久久久久久久久久久久久| 青青精品视频播放| 国产欧美日韩视频一区二区三区| 久久人人爽国产| 国产精品美乳一区二区免费| 久久av.com| 天堂av在线中文| 免费久久99精品国产自| 91精品视频在线免费观看| 久久视频精品在线| 亚洲国产精品视频一区| 欧美精品卡一卡二| 97久久精品国产| 国产精品女人网站| 久久久久人妻精品一区三寸| 中文字幕欧美日韩一区二区| 青青久久av北条麻妃黑人| 亚洲影院在线看| 欧美精品久久久| 久久久在线观看| 国产精品极品美女粉嫩高清在线| 性高湖久久久久久久久aaaaa| 国内精品久久久久久久久| 久久久中精品2020中文| 欧美激情中文网| 欧美精品国产精品久久久| 成人a在线视频| 欧美另类在线播放| 欧美精品久久久久久久免费 | 国产aⅴ精品一区二区三区黄|