99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代寫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設計編程
  • 下一篇:菜鳥錢包強制下款怎么辦?如何聯系菜鳥錢包客服電話解決問題?
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                99国产欧美久久久精品| 粉嫩aⅴ一区二区三区四区 | 五月婷婷另类国产| 欧美一级搡bbbb搡bbbb| 青青草国产成人av片免费| 国产视频一区在线播放| 91蜜桃婷婷狠狠久久综合9色| 亚洲人成网站色在线观看| 欧美日韩国产经典色站一区二区三区| 国产精品无遮挡| 欧美亚洲国产怡红院影院| 精品一区二区综合| 亚洲欧美在线另类| 日韩午夜精品电影| 成人av先锋影音| 日本免费在线视频不卡一不卡二| 国产视频视频一区| 欧美二区乱c少妇| 99精品久久免费看蜜臀剧情介绍| 国产欧美日韩精品在线| 91麻豆精品国产91久久久| 99久久综合狠狠综合久久| 亚洲小说春色综合另类电影| 中文字幕av一区 二区| 91精品麻豆日日躁夜夜躁| 丁香激情综合国产| 亚洲欧洲韩国日本视频| 久久影视一区二区| 日韩欧美在线影院| 欧美男男青年gay1069videost | 国产一区二区视频在线播放| 亚洲高清免费视频| 一区二区三区电影在线播| 国产网红主播福利一区二区| 日韩精品一区二区三区在线观看 | 成人精品国产福利| 久久成人精品无人区| 夜夜爽夜夜爽精品视频| 中文字幕第一页久久| 久久日韩粉嫩一区二区三区 | 亚洲精品欧美激情| 亚洲日本在线a| 亚洲猫色日本管| 最新中文字幕一区二区三区| 2023国产一二三区日本精品2022| 欧美一区二区久久| 欧美亚洲日本一区| 日本一区二区三区免费乱视频| 亚洲国产视频在线| 成人激情动漫在线观看| 日韩女同互慰一区二区| 亚洲精品久久7777| 国产精品一区专区| 这里只有精品免费| 亚洲激情在线激情| 成人黄色在线看| 精品国产乱码久久久久久闺蜜| 亚洲在线免费播放| www.亚洲激情.com| 久久一日本道色综合| 午夜精品一区二区三区三上悠亚 | 91精品在线一区二区| 国产精品久久久久四虎| 久久www免费人成看片高清| 欧美色图片你懂的| 亚洲欧美日韩国产成人精品影院| 国产精品自拍在线| xf在线a精品一区二区视频网站| 亚洲影院久久精品| 日本高清无吗v一区| 亚洲欧洲精品天堂一级| 不卡欧美aaaaa| 国产日韩欧美亚洲| 国产乱人伦精品一区二区在线观看 | 午夜精品福利一区二区三区av| 不卡的电影网站| 国产丝袜在线精品| 国产麻豆视频精品| 精品久久久久久久久久久院品网 | 久久久久九九视频| 久久99精品国产| 精品国产伦一区二区三区观看方式| 日韩电影一区二区三区| 欧美一区中文字幕| 日韩av电影天堂| 欧美一区国产二区| 精品一区二区三区免费观看 | 亚洲国产精品久久不卡毛片 | 欧美日韩精品一区二区三区四区| 一区二区三区在线免费观看| 91视频观看视频| 一区二区免费看| 制服丝袜亚洲播放| 激情五月激情综合网| 国产日产欧美精品一区二区三区| 国产成人精品免费一区二区| 国产精品入口麻豆九色| 91视频免费播放| 亚洲第一福利一区| 91精品国模一区二区三区| 黑人巨大精品欧美一区| 中文字幕av一区二区三区| 99国产精品久| 性做久久久久久久久| 欧美精品一区二区三区在线播放 | 国产激情一区二区三区四区 | 波多野结衣在线aⅴ中文字幕不卡| 亚洲国产精品99久久久久久久久 | 久久精品国产亚洲5555| 欧美国产在线观看| 色老头久久综合| 精品一区二区在线观看| 亚洲人吸女人奶水| 91精品国产综合久久小美女| 国产不卡高清在线观看视频| 亚洲精选视频免费看| 91精品一区二区三区久久久久久| 国产一区二区三区在线观看免费视频 | 亚洲综合成人在线| 91精品国产福利| 国产成+人+日韩+欧美+亚洲| 亚洲色图一区二区| 欧美一三区三区四区免费在线看| 久久精品99国产精品日本| 国产精品天美传媒| 91福利视频在线| 麻豆精品在线看| 亚洲免费av高清| 7777精品伊人久久久大香线蕉 | 国产河南妇女毛片精品久久久 | 26uuu成人网一区二区三区| 日本高清不卡一区| 风间由美性色一区二区三区| 日韩中文字幕不卡| 尤物视频一区二区| 亚洲国产精品v| 日韩一卡二卡三卡四卡| 欧美中文字幕一二三区视频| 国产一区二区三区四| 亚洲成年人网站在线观看| 国产精品国产三级国产aⅴ原创| 欧美一级日韩不卡播放免费| 欧美中文字幕亚洲一区二区va在线 | 欧美男男青年gay1069videost | 99国产精品久久| 国产在线精品一区二区不卡了| 亚洲成人av一区二区| 亚洲免费av观看| 日韩理论片一区二区| 在线观看91精品国产麻豆| 欧美视频一区二区三区在线观看 | 精品欧美一区二区在线观看| 欧美影视一区在线| 99国内精品久久| 成人精品gif动图一区| 国产精品一区二区在线播放| 激情国产一区二区| 最新国产精品久久精品| 中文字幕精品—区二区四季| 欧美激情一区三区| 欧美va亚洲va香蕉在线| 精品精品欲导航| 久久色视频免费观看| 久久久av毛片精品| 国产日韩欧美高清在线| 精品国产污网站| 久久免费美女视频| 精品国产123| 国产喷白浆一区二区三区| 中文字幕乱码一区二区免费| 日本一区二区三区四区| 中文字幕日韩一区| 一区二区三区四区五区视频在线观看| 国产精品久久久久久久岛一牛影视| 欧美国产日本韩| 亚洲视频一区在线| 亚洲国产日韩a在线播放性色| 亚洲成av人影院| 久久超碰97人人做人人爱| 大陆成人av片| 日本道精品一区二区三区| 欧美亚洲国产怡红院影院| 日韩欧美综合一区| 欧美激情一区二区三区不卡| 亚洲免费视频成人| 亚洲大片精品永久免费| 麻豆视频观看网址久久| 国产自产v一区二区三区c| 粉嫩嫩av羞羞动漫久久久| 色88888久久久久久影院野外| 欧美日韩一级片在线观看| 精品国产自在久精品国产| |精品福利一区二区三区| 亚洲国产综合91精品麻豆| 国内外成人在线| 色噜噜狠狠色综合中国| 精品国产一区二区三区四区四| 国产精品蜜臀av| 日韩国产高清在线| av一区二区不卡|