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

        comp2123代做、代寫(xiě)c/c++,Python設(shè)計(jì)編程
        comp2123代做、代寫(xiě)c/c++,Python設(shè)計(jì)編程

        時(shí)間:2025-03-29  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



        comp2123 Assignment 1 s1 2025
        This assignment is due on March 25 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. (10 points)
        Given an array A consisting of n integers, we want to compute a matrix B where
        for any 0 ≤ i < j < n we have
        B[i][j] = f([A[i], A[i + 1], ..., A[j − 1]])
        Consider the following algorithm for computing B:
        Algorithm 1 Range Function Computation
        1: function RangeFunc(A)
        2: B ← new n × n matrix
        3: for i ← 0 to n − 1 do
        4: for j ← i + 1 to n − 1 do
        5: C ← make a copy of A[i : j]
        6: B[i][j] ← f(C)
        7: return B
        Assume that f(C) runs in Θ(log |C|) time.
        Using O-notation, upperbound the running time of RangeFunc. Explain
        your answer with a detailed line by line analysis.
        a)
        Using Ω-notation, lowerbound the running time of RangeFunc. Explain
        your answer.
        b)
        1
        comp2123 Assignment 1 s1 2025
        Problem 2. (25 points)
        We would like to design an augmented queue data structure. In addition to
        the usual ❡♥q✉❡✉❡ and ❞❡q✉❡✉❡ operations, you need to support the ❡✈❡♥✲❞✐❢❢
        operation, which when run on a queue Q = ⟨q0, q1, q2, . . . , qn−1⟩ returns

        0≤i<n−1 s.t. i is even
        |qi − qi+1
        |.
        Examples:
        • ❡✈❡♥✲❞✐❢❢([1, 3, 50, 48]) returns 4,
        • ❡✈❡♥✲❞✐❢❢([1, 3, 50, 48, 30]) returns 4,
        • ❡✈❡♥✲❞✐❢❢([3, 50, 48, 30]) returns 65.
        We are to design an implementation of the methods ❡♥q✉❡✉❡, ❞❡q✉❡✉❡, and
        ❡✈❡♥✲❞✐❢❢ so that all operations run in O(1) time. You can assume that the data
        structure always starts from the empty queue.
        Your data structure should take O(n) space, where n is the number of ele ments currently stored in the data structure.
        Your task is to:
        Design a data structure that supports the required operations in the re quired time and space.
        a)
        b) Briefly argue the correctness of your data structure and operations.
        c) Analyse the running time of your operations and space of your data structure.
        2
        comp2123 Assignment 1 s1 2025
        Problem 3. (25 points)
        A skyline is defined by an array of n distinct integers A = [h0, h1, h2, h3, h4, ...., hn−1]
        representing the heights of buildings in a one-dimensional city, given in the or der they appear from left to right. Suppose you are standing on the rooftop of
        one of these buildings. You want to determine the closest taller building to your
        left and the closest taller building to your right. The goal is to find an efficient
        algorithm to compute this for ALL n buildings.
        Specifically, for every building x ∈ [0, n − 1], compute the two closest indices i
        and j to x such that:
        i < x, j > x, A[i] > A[x] and A[j] > A[x].
        Your algorithm should return two arrays of length n:
        L[0...n − 1] where L[x] denotes the index (i) of the nearest taller building to
        the left of building x (or ◆♦♥❡ if no such building exists).
        R[0...n − 1] where R[x] denotes the index (j) of the nearest taller building to
        the right of building x (or ◆♦♥❡ if no such building exists).
        Note:
        • A[∗] denotes the element at index ∗ in the array.
        • Indices start at 0.
        Examples:
        Input: A=[7,3,9,12,2,6,5,15]
        Output:
        L=[None, 0, None, None, 3, 3, 5, None]
        R=[2, 2, 3, 7, 5, 7, 7, None]
        Input: A=[6,2,4,1,10,7,8,11]
        Output:
        L=[None, 0, 0, 2, None, 4, 4, None]
        R=[4, 2, 4, 4, 7, 6, 7, None]
        Input: A=[10,3,2]
        Output:
        L=[None, 0, 1]
        R=[None, None, None]
        Design an algorithm to solve this problem in O( n2) time. a)
        b) Prove your algorithm is correct.
        c) Analyse the running time of your algorithm.
        3
        comp2123 Assignment 1 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.


        請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

        掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
      1. 上一篇:代寫(xiě)EG2002、代做Java/Python程序語(yǔ)言
      2. 下一篇:代寫(xiě)comp2123、代做Java/C++程序語(yǔ)言
      3. ·C39RF程序代寫(xiě)、代做Python設(shè)計(jì)編程
      4. ·CCIT4016代做、代寫(xiě)Python設(shè)計(jì)編程
      5. ·代寫(xiě)Project 2: Connect 4、代做Python設(shè)計(jì)編程
      6. ·代寫(xiě)INFS2044、代做Python設(shè)計(jì)編程
      7. ·ECE 498代寫(xiě)、代做Python設(shè)計(jì)編程
      8. ·代寫(xiě)COSC2531、代做Python設(shè)計(jì)編程
      9. ·代寫(xiě)FIT2107、代做Python設(shè)計(jì)編程
      10. ·代寫(xiě)ECE4016、Python設(shè)計(jì)編程代做
      11. ·代做INCS 775、代寫(xiě)python設(shè)計(jì)編程
      12. ·代做COMP 412、代寫(xiě)python設(shè)計(jì)編程
      13. 合肥生活資訊

        合肥圖文信息
        出評(píng) 開(kāi)團(tuán)工具
        出評(píng) 開(kāi)團(tuán)工具
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        戴納斯帝壁掛爐全國(guó)售后服務(wù)電話(huà)24小時(shí)官網(wǎng)400(全國(guó)服務(wù)熱線)
        戴納斯帝壁掛爐全國(guó)售后服務(wù)電話(huà)24小時(shí)官網(wǎng)
        菲斯曼壁掛爐全國(guó)統(tǒng)一400售后維修服務(wù)電話(huà)24小時(shí)服務(wù)熱線
        菲斯曼壁掛爐全國(guó)統(tǒng)一400售后維修服務(wù)電話(huà)2
        美的熱水器售后服務(wù)技術(shù)咨詢(xún)電話(huà)全國(guó)24小時(shí)客服熱線
        美的熱水器售后服務(wù)技術(shù)咨詢(xún)電話(huà)全國(guó)24小時(shí)
        海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
      14. 短信驗(yàn)證碼 酒店vi設(shè)計(jì) 投資移民

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

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

        亚洲精品乱码久久久久久蜜桃图片 | 久久精品一区二区影院| 国产农村乱子伦精品视频| 久久亚洲欧美国产精品| 18精品久久久无码午夜福利| 久久国产精品亚洲一区二区| 亚洲色精品88色婷婷七月丁香| 亚洲精品亚洲人成在线观看下载| 欧洲MV日韩MV国产| 国产伦精品一区二区三区四区| 69精品人人人人人人人人人| 最新日韩精品中文字幕| 国产92成人精品视频免费| 91精品国产网曝事件门| 日韩精品国产另类专区| 国产精品一区二区久久国产| 国产在线观看高清精品| 91精品国产高清91久久久久久| 国产乱码伦精品一区二区三区麻豆| 亚洲综合国产精品第一页 | 无码精品人妻一区二区三区中| 久久精品国产亚洲综合色| assbbwbbwbbwbbwbw精品| 尹人久久久香蕉精品| 成人区精品一区二区不卡 | 中文字幕精品一区二区精品| 亚洲福利精品一区二区三区| 日韩无套内射视频6| 竹菊影视欧美日韩一区二区三区四区五区 | 91大神精品全国在线观看| 91国语精品自产拍在线观看一| 精品无码AV一区二区三区不卡| 久久久精品国产sm调教网站| 99精品热线在线观看免费视频| 久久久久久国产精品免费无码| 91在线精品中文字幕| 久久精品久久久久观看99水蜜桃| 777精品成人影院| 国产亚洲精品影视在线| 日韩精品射精管理在线观看| 青春草国产成人精品久久|