21 views

Uploaded by Antonio Manoel

- TUNABLE MIXED DECIMATION MULTIPATH DELAY FEEDBACK FOR RADIX 2K FFT.
- daa file
- fixed_point.pdf
- HW0
- Effect List
- end-of-year assessment
- Comparative Report on Programming Languages 2
- Assignment rhgcf
- QM2 Session 4
- Maths Notes
- Tree
- The Algorithm on Staad Syntax
- Unix Programs 2
- a1
- Data Structure Midterm Activity
- LRandLALRconflict
- Dsp
- Embedded Systems Lesson Plan
- Lesson Plan Math Discrete
- patgeo.pdf

You are on page 1of 3

Question 1 Divide-and-Conquer

Suppose you are given an array A with n entries, with each entry holding a distinct number. You are told that the sequence of values A[1], A[2], . . . , A[n] is unimodal: For some index p between 1 and n the values in the array entries increase up to position p in A and then decrease the remainder of the way until position n. (So if you were to draw a plot with the array position j on the x-axis and the value of the entry A[j ] on the y -axis tile plotted points would rise until x-value p, where theyd achieve their maximum and then fall from there on.) Youd like to nd the peak entry p without having to read the entire arrayin fact, by reading as few entries of A as possible Show how to nd the entry p by reading at most O(log n) entries of A. (Hint : Assume n = 2k and nd the recurrence of the running time) Solution: Look at the value A[n/2] and its adjacent values: 1. if A[n/2 1] < A[n/2] < A[n/2 + 1] then p > n/2, we call recursively on entries n/2 + 1 through n. 2. if A[n/2 1] > A[n/2] > A[n/2 + 1] then p < n/2, we call recursively on entries 1 through n/2 1. 3. if A[n/2] > A[n/2 1] and A[n/2] > A[n/2 + 1] then p = n/2.

FindPeakEntry(A,a,b) m

a+b 2

if A[m] > A[m 1] and A[m] < A[m + 1] then FindPeakEntry(A,m + 1,b) else if A[m] < A[m 1] and A[m] > A[m + 1] then FindPeakEntry(A,a, m 1) else return m

In lectures we have seen the problem of Longest Common Subsequence (LCS), where given two sequences X and Y we wanted to nd an LCS of X and Y (a subsequence of a sequence S is obtained by deleting some of the letters in S ). Given two sequences X and Y , we say Z is a common supersequence of them if both X and Y are subsequences of Z . For instance, abbacd is a supersequence of aba and bbcd. Given X = x1 x2 . . . xn and Y = y1 y2 . . . ym , the goal is to nd a Shortest Common Supersequence (SCS) of X and Y using dynamic programming. Hint : We can dene the subproblems and then give the recurrence for the solutions. Step 1 : Dene an appropriate array/table S (corresponding to the subproblems) and say how to extract the solution from the array. Step 2 : Give a recurrence (including the base cases) to compute the entries of your array. Briey explain how you derive this recurrence. Step 3 : Give a pseudocode to compute the entries of the array using your recurrence. Step 4 : Extract a Shortest Common Supersequence from the array. Solution: Step 1 : For any 0 i n and 0 j m, let Xi denote the sequence x1 . . . xi and Yj denote the sequence y1 . . . yj , respectively. Note that Xn = X and Ym = Y . We dene S [i, j ] (0 i n, 0 j m) to be the length of SCS of Xi and Yj . By this denition, the length of SCS of X and Y will be S [n, m]. Step 2 : Clearly the SCS of the empty string and any string T is T itself. Therefore for any value of 0 i n and 0 j m: S [i, 0] = i and S [0, j ] = j . If i, j 1 then to compute S [i, j ] we consider the last elements of Xi and Yj (i.e. xi and yj ): If xi = yj then they can be paired with the same element of an SCS of Xi and Yj . In other words, adding xi to the SCS of Xi1 and Yj 1 will form an SCS of Xi and Yj which has length S [i 1, j 1] + 1. If xi = yj then either we have to add xi to the SCS of Xi1 and Yj , or we have to add yj to the SCS of Xi and Yj 1 . Taking the minimum among these two cases gives the answer.

So we get the following recurrence: S [i, 0] = i and S [0, j ] = j , for any 0 i n, 0 j m. If i, j > 0 then: S [i 1, j ] + 1, S [i, j ] = min S [i, j 1] + 1, S [i 1, j 1] + 1, xi = yj

- TUNABLE MIXED DECIMATION MULTIPATH DELAY FEEDBACK FOR RADIX 2K FFT.Uploaded byIJAR Journal
- daa fileUploaded byYog Kunwar
- fixed_point.pdfUploaded byويبقى الأمل
- HW0Uploaded byLaura Makda
- Effect ListUploaded byChristoph St
- end-of-year assessmentUploaded byapi-253811134
- Comparative Report on Programming Languages 2Uploaded byGilzpo
- Assignment rhgcfUploaded bysivasaipranavj
- QM2 Session 4Uploaded bySamson Anto Kingsley
- Maths NotesUploaded byravi
- TreeUploaded byFreedom Storm
- The Algorithm on Staad SyntaxUploaded byGagandeep
- Unix Programs 2Uploaded byNagender Andugula
- a1Uploaded bysome_guy_box
- Data Structure Midterm ActivityUploaded byNanyer Asonipse Zelimafed
- LRandLALRconflictUploaded bysweettani
- DspUploaded byAfraz Khan
- Embedded Systems Lesson PlanUploaded byMercy Anoop
- Lesson Plan Math DiscreteUploaded byakula
- patgeo.pdfUploaded byKhAn Zainab
- Lecture 1-Set TheoryUploaded byVivek Shah
- MATH1081+2012+S2Uploaded byneo
- xmassudokuUploaded byderegnal
- Math53 Fa09 Mt2 Frenkel SolnUploaded byRachael Wells
- Integral Calc 1Uploaded byLanz de la Cruz
- Sol1Uploaded byNg Chun Hiu
- Java practice question.Uploaded byPushpa Latha
- CH05.pdfUploaded byHugo
- hw12.pdfUploaded byAashish D
- c4-r3: Algorithm Analysis and Design Note: 1.Uploaded byvikassonwal

- Alga 1 Conicas 3 ExerciciosUploaded byPhilippe Harsady
- Lista de ExerciciosUploaded byAntonio Manoel
- 7_AlgoritmosAproximadosUploaded byAntonio Manoel
- A CANÇÃO DE ROLANDO.pdfUploaded byDeecopiadora Copiadora
- ICC2 05.Analise de Algoritmos Parte4Uploaded byAntonio Manoel
- 6_TeoriaComplexidadeUploaded byAntonio Manoel
- limites trigonometricos resolvidosUploaded byjp_natario
- aa_apsUploaded byPriscila E Mauri Reis
- 3_RecorrenciaUploaded byAntonio Manoel
- 5_AlgGulosoUploaded byAntonio Manoel
- 3.1_paradigmas_projetoUploaded byAntonio Manoel
- 1_IntroducaoUploaded byAntonio Manoel
- 3.2_grafosUploaded byAntonio Manoel
- 4_ProgDinamicaUploaded byJeovane Reges
- md_LE6_Solucao.pdfUploaded byAntonio Manoel
- 2_NotacaoAssintoticaUploaded byAntonio Manoel

- Demand Gen vs Lead Nurturing: Understand the Difference to Optimize Your Sales & Marketing FunnelUploaded byCisco Partner Marketing Accelerate
- computer_graphics_tutorial.pdfUploaded byAbhishek Dhadwal
- Controlling - Internal OrdersUploaded byandysajan
- VBA IntiUploaded bykprdeepak
- 75 Toad for Oracle TipsUploaded byrhsabbir007
- Application SCADA SebalogD EngUploaded byR.c. Tolentino
- Numerical Methods for Large Eigenvalue ProblemsUploaded byQuinton Boltin
- ch1Uploaded byAlex Li
- Modify Cell PDCCH Algorithm ConfigurationUploaded byAriev Ikank
- ExampleUserAcceptanceTest PlanUploaded bykris_acc85
- Practical No 5Uploaded byshyam rana
- Report-designer-Manual-18-Appendix-III.pdfUploaded byheavenangel
- 98594-90006 a Beginners Guide to HP-UX Sep89Uploaded byRakhe Khanna
- Transistor Sizing -TSPC and C2MOSUploaded byHarshal Ambatkar
- HPProLiantDL360G9RAIDConfiguration.pdfUploaded byWan Hafizi
- Behavior of Laterally Loaded PilesUploaded byVijay Dandage
- IJAITUploaded byijaitjournal
- AutoLispUploaded bymaomedalid
- Lexical AnalysisUploaded byFazle Hannan
- compilers and interpretersUploaded bykiran6114
- Actual Tools User ManualUploaded byAbhi Shek
- PVP6 Firmware Upgrade Package 6.10-20120418Uploaded bynegrin
- Computer Graphics 3D Display MethodsUploaded bySyedkareem_hkg
- peerj-cs-55Uploaded bySergey Kojoian
- Intensity HistogramUploaded bybasab_ecens
- Telecom Framework OverviewUploaded bysanchit_dalvi
- K 12ModelCurr2ndEdUploaded byptbestari
- DA Analysis of 3D ICUploaded byPavin Ka
- Bektur Baizhanov, John T. Baldwin and Saharon Shelah- Subsets of superstable structures are weakly benignUploaded byUltmas
- Cluster AdministrationUploaded byAugusto Decoud