tutorbin

design and analysis of algorithms homework help

Boost your journey with 24/7 access to skilled experts, offering unmatched design and analysis of algorithms homework help

tutorbin

Trusted by 1.1 M+ Happy Students

Place An Orderand save time
man
phone
  • United States+1
  • United Kingdom+44
  • Afghanistan (‫افغانستان‬‎)+93
  • Albania (Shqipëri)+355
  • Algeria (‫الجزائر‬‎)+213
  • American Samoa+1
  • Andorra+376
  • Angola+244
  • Anguilla+1
  • Antigua and Barbuda+1
  • Argentina+54
  • Armenia (Հայաստան)+374
  • Aruba+297
  • Ascension Island+247
  • Australia+61
  • Austria (Österreich)+43
  • Azerbaijan (Azərbaycan)+994
  • Bahamas+1
  • Bahrain (‫البحرين‬‎)+973
  • Barbados+1
  • Belarus (Беларусь)+375
  • Belgium (België)+32
  • Belize+501
  • Benin (Bénin)+229
  • Bermuda+1
  • Bhutan (འབྲུག)+975
  • Bolivia+591
  • Bosnia and Herzegovina (Босна и Херцеговина)+387
  • Botswana+267
  • Brazil (Brasil)+55
  • British Indian Ocean Territory+246
  • British Virgin Islands+1
  • Brunei+673
  • Bulgaria (България)+359
  • Burkina Faso+226
  • Burundi (Uburundi)+257
  • Cambodia (កម្ពុជា)+855
  • Cameroon (Cameroun)+237
  • Canada+1
  • Cape Verde (Kabu Verdi)+238
  • Caribbean Netherlands+599
  • Cayman Islands+1
  • Central African Republic (République centrafricaine)+236
  • Chad (Tchad)+235
  • Chile+56
  • China (中国)+86
  • Christmas Island+61
  • Cocos (Keeling) Islands+61
  • Colombia+57
  • Comoros (‫جزر القمر‬‎)+269
  • Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)+243
  • Congo (Republic) (Congo-Brazzaville)+242
  • Cook Islands+682
  • Costa Rica+506
  • Côte d’Ivoire+225
  • Croatia (Hrvatska)+385
  • Cuba+53
  • Curaçao+599
  • Cyprus (Κύπρος)+357
  • Czech Republic (Česká republika)+420
  • Denmark (Danmark)+45
  • Djibouti+253
  • Dominica+1
  • Dominican Republic (República Dominicana)+1
  • Ecuador+593
  • Egypt (‫مصر‬‎)+20
  • El Salvador+503
  • Equatorial Guinea (Guinea Ecuatorial)+240
  • Eritrea+291
  • Estonia (Eesti)+372
  • Eswatini+268
  • Ethiopia+251
  • Falkland Islands (Islas Malvinas)+500
  • Faroe Islands (Føroyar)+298
  • Fiji+679
  • Finland (Suomi)+358
  • France+33
  • French Guiana (Guyane française)+594
  • French Polynesia (Polynésie française)+689
  • Gabon+241
  • Gambia+220
  • Georgia (საქართველო)+995
  • Germany (Deutschland)+49
  • Ghana (Gaana)+233
  • Gibraltar+350
  • Greece (Ελλάδα)+30
  • Greenland (Kalaallit Nunaat)+299
  • Grenada+1
  • Guadeloupe+590
  • Guam+1
  • Guatemala+502
  • Guernsey+44
  • Guinea (Guinée)+224
  • Guinea-Bissau (Guiné Bissau)+245
  • Guyana+592
  • Haiti+509
  • Honduras+504
  • Hong Kong (香港)+852
  • Hungary (Magyarország)+36
  • Iceland (Ísland)+354
  • Indonesia+62
  • Iran (‫ایران‬‎)+98
  • Iraq (‫العراق‬‎)+964
  • Ireland+353
  • Isle of Man+44
  • Israel (‫ישראל‬‎)+972
  • Italy (Italia)+39
  • Jamaica+1
  • Japan (日本)+81
  • Jersey+44
  • Jordan (‫الأردن‬‎)+962
  • Kazakhstan (Казахстан)+7
  • Kenya+254
  • Kiribati+686
  • Kosovo+383
  • Kuwait (‫الكويت‬‎)+965
  • Kyrgyzstan (Кыргызстан)+996
  • Laos (ລາວ)+856
  • Latvia (Latvija)+371
  • Lebanon (‫لبنان‬‎)+961
  • Lesotho+266
  • Liberia+231
  • Libya (‫ليبيا‬‎)+218
  • Liechtenstein+423
  • Lithuania (Lietuva)+370
  • Luxembourg+352
  • Macau (澳門)+853
  • North Macedonia (Македонија)+389
  • Madagascar (Madagasikara)+261
  • Malawi+265
  • Malaysia+60
  • Maldives+960
  • Mali+223
  • Malta+356
  • Marshall Islands+692
  • Martinique+596
  • Mauritania (‫موريتانيا‬‎)+222
  • Mauritius (Moris)+230
  • Mayotte+262
  • Mexico (México)+52
  • Micronesia+691
  • Moldova (Republica Moldova)+373
  • Monaco+377
  • Mongolia (Монгол)+976
  • Montenegro (Crna Gora)+382
  • Montserrat+1
  • Morocco (‫المغرب‬‎)+212
  • Mozambique (Moçambique)+258
  • Myanmar (Burma) (မြန်မာ)+95
  • Namibia (Namibië)+264
  • Nauru+674
  • Nepal (नेपाल)+977
  • Netherlands (Nederland)+31
  • New Caledonia (Nouvelle-Calédonie)+687
  • New Zealand+64
  • Nicaragua+505
  • Niger (Nijar)+227
  • Nigeria+234
  • Niue+683
  • Norfolk Island+672
  • North Korea (조선 민주주의 인민 공화국)+850
  • Northern Mariana Islands+1
  • Norway (Norge)+47
  • Oman (‫عُمان‬‎)+968
  • Palau+680
  • Palestine (‫فلسطين‬‎)+970
  • Panama (Panamá)+507
  • Papua New Guinea+675
  • Paraguay+595
  • Peru (Perú)+51
  • Philippines+63
  • Poland (Polska)+48
  • Portugal+351
  • Puerto Rico+1
  • Qatar (‫قطر‬‎)+974
  • Réunion (La Réunion)+262
  • Romania (România)+40
  • Russia (Россия)+7
  • Rwanda+250
  • Saint Barthélemy+590
  • Saint Helena+290
  • Saint Kitts and Nevis+1
  • Saint Lucia+1
  • Saint Martin (Saint-Martin (partie française))+590
  • Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)+508
  • Saint Vincent and the Grenadines+1
  • Samoa+685
  • San Marino+378
  • São Tomé and Príncipe (São Tomé e Príncipe)+239
  • Saudi Arabia (‫المملكة العربية السعودية‬‎)+966
  • Senegal (Sénégal)+221
  • Serbia (Србија)+381
  • Seychelles+248
  • Sierra Leone+232
  • Singapore+65
  • Sint Maarten+1
  • Slovakia (Slovensko)+421
  • Slovenia (Slovenija)+386
  • Solomon Islands+677
  • Somalia (Soomaaliya)+252
  • South Africa+27
  • South Korea (대한민국)+82
  • South Sudan (‫جنوب السودان‬‎)+211
  • Spain (España)+34
  • Sri Lanka (ශ්‍රී ලංකාව)+94
  • Sudan (‫السودان‬‎)+249
  • Suriname+597
  • Svalbard and Jan Mayen+47
  • Sweden (Sverige)+46
  • Switzerland (Schweiz)+41
  • Syria (‫سوريا‬‎)+963
  • Taiwan (台灣)+886
  • Tajikistan+992
  • Tanzania+255
  • Thailand (ไทย)+66
  • Timor-Leste+670
  • Togo+228
  • Tokelau+690
  • Tonga+676
  • Trinidad and Tobago+1
  • Tunisia (‫تونس‬‎)+216
  • Turkey (Türkiye)+90
  • Turkmenistan+993
  • Turks and Caicos Islands+1
  • Tuvalu+688
  • U.S. Virgin Islands+1
  • Uganda+256
  • Ukraine (Україна)+380
  • United Arab Emirates (‫الإمارات العربية المتحدة‬‎)+971
  • United Kingdom+44
  • United States+1
  • Uruguay+598
  • Uzbekistan (Oʻzbekiston)+998
  • Vanuatu+678
  • Vatican City (Città del Vaticano)+39
  • Venezuela+58
  • Vietnam (Việt Nam)+84
  • Wallis and Futuna (Wallis-et-Futuna)+681
  • Western Sahara (‫الصحراء الغربية‬‎)+212
  • Yemen (‫اليمن‬‎)+967
  • Zambia+260
  • Zimbabwe+263
  • Åland Islands+358
*Get instant homework help from top tutors—just a WhatsApp message away. 24/7 support for all your academic needs!

Recently Asked design and analysis of algorithms Questions

Expert help when you need it
  • Q1:# Project 3: Griefer list ## Introduction Your job working at the MMORPG is going great. After a recent promotion, you've been assigned a more challenging task. The game has become popular enough to attract large numbers of griefers, which use trial accounts to troll and harass your paying customers. Given that the rules are different on different servers, each server maintains its own ban list. To help server admins out, you want to build a tool that lets them quickly lookup whether a player has been banned and when the most recent ban was. You already have a tool that concatenates all the banlists together and consists of lines with the following format: [USERNAME] [SERVERID] [UNIX_TIME_OF_BAN] Example line: bmrlpmyzybrb 819 1636184756 (the trolls seem to like to use randomly generated names) Your tool will read a single input file consisting of a number of lines like the one above, and will insert the players into a self-balancing tree data structure, organized by user name. Along with the above data (which is stored in a file), your tool will also read a list of names from standard input. For each name, it will print a prepared statement (see sample) that contains the name, the number of servers they've been banned on, and the most recent ban they received. You know that a tree is appropriate for this task as there might be duplicate data, and you want to be able to find spans of names in sorted order later. However, you aren't sure which tree to use. You know that given the large number of inserts into the data structure that a scapegoat tree would be appropriate. However, you want to compare it with at least one of these trees: * AVL tree * Red black tree * B-treeSee Answer
  • Q2:3. Consider the following recursive algorithm, where array is an array of integers. You can assume that the length of array is a power of two, so len(array) is n = 2m for some m ≥ 0. (a) (1 marks) How many array accesses are made in total by calling squoogle (array)? An array access means that you evaulate array[i] for some i. Write your answer as a recursive formula in terms of m. You can treat the arguments to the recursive calls as if they do not require array accesses to compute. (b) (2 marks) Give a closed-form expression for your formula from part a) in terms of m. Prove your answer is correct using induction. (c) (0.5 marks) What is your closed-form expression from part b) in terms of n, the number of elements in the array?See Answer
  • Q3:3. Recall that as we discussed in class, there is no known fast algorithm for graph isomorphism, and it is believed that no such algorithm exists. However, it is often possible to solve graph isomorphism quickly if there are restrictions on the types of graphs allowed as input. Your best friend Fred has a proposal for an alternative graph isomorphism algorithm when the input graphs are restricted to be trees. He suggests the following: 1) For each vertex v in G₁, compute deg(v) and append this value to a list L₁. 2) For each vertex v in G₂, compute deg(v) and append this value to a list L2. 3) Sort the lists L₁ and L2 in increasing order. 4) If L₁ and L₂ are the same, reutrn "yes", otherwise return "no”. Does Fred's algorithm work on all possible inputs? You can assume the input graphs are both trees. Prove your answer is correct.See Answer
  • Q4:4. Give the binary representation for the following tree, showing your intermediate work. Answers consisting of only a binary string will not be marked.See Answer
  • Q5: Prove, by induction on k, that level k of a binary tree has less than or equal to 2* nodes (root level has k=0).See Answer
  • Q6:Let A[1 .. n] be an array of n distinct numbers. If i<j and A[i]>A[j], then the pair (i, j) is called an inversion of A. 6a) List the five inversions of the array <2, 3, 8, 6, 1>. 6b) What array with elements from the set {1, 2,..., n} has the most inversions? How many does it have? 6c) What is the relationship between the running time of insertion sort and the number of inversions in the input array? Justify your answer. 6d) Give an algorithm that determines the number of inversions in any permutation on n elements in O(n lg n) worst-case time. (Hint: Modify merge sort.)See Answer
  • Q7:Problem 1 Recurrence Define T(n) for n € Z+ by the recurr T(n) = recurrence for n = 1 {7 (41) +1 T (1) + 1 for n ≥ 2 log(n) for all n ≥ 1, and hence, T(n) = N(log(n)). Prove that T(n) (1)See Answer
  • Q8:Problem 2 Substitution method Use the substitution method to show that the solution to - {³s (121) +1 s(n) = if n = 1,2 98 () +1 if n ≥ 3 satisfies S(n) = O(n²). (2)See Answer
  • Q9:Problem 4 Iteration method Consider the following recurrence relation: T(n) = 8T T (177) + ₂ 3 Apply the Master Theorem to find the tight asymptotic bounds for T(n).See Answer
  • Q10:1. Compute the following sums. a. 1+3+5+7+ +999 b. 2+4+8+16+...+1024 c Σ+1 d. Σ"}; 1. Σ–13+1g. Σ Σ - e Σ"di( + 1) Ξ 2. Find the order of growth of the following sums. Use the Θ(g(n)) notation with the simplest function g(n) possible. a. Σ"=(2+1)2 € Σ=1 + 1)2-1 b. Σ={1gi2 d. Σ. Σ( + 3)/n4. Consider the following algorithm. ALGORITHM Mystery (n) //Input: A nonnegative integer n S←0 for i ← 1 to n do S+S+i*i return S a. What does this algorithm compute? b. What is its basic operation? c. How many times is the basic operation executed? d. What is the efficiency class of this algorithm? e. Suggest an improvement, or a better algorithm altogether, and indicate its efficiency class. If you cannot do it, try to prove that, in fact, it cannot be done.See Answer
  • Q11:5. Consider the following algorithm. ALGORITHM Secret(A[0..n-1]) //Input: An array A[0..n-1] of n real numbers minval A[0]; maxval ← A[0] for i 1 to n - 1 do if A[i] < minval minval ← A[i] if A[i]> maxval maxval ← A[i] return maxval - minval Answer questions (a)-(e) of Problem 4 about this algorithm./n4. Consider the following algorithm. ALGORITHM Mystery (n) //Input: A nonnegative integer n S 0 for i ← 1 to n do S+S+i*i return S a. What does this algorithm compute? b. What is its basic operation? c. How many times is the basic operation executed? d. What is the efficiency class of this algorithm? e. Suggest an improvement, or a better algorithm altogether, and indicate its efficiency class. If you cannot do it, try to prove that, in fact, it cannot be done.See Answer
  • Q12:4. Consider the following recursive algorithm. ALGORITHM Q(n) //Input: A positive integer if n = 1 return 1 else return Q(n-1) + 2 *n-1/nb. Set up a recurrence relation for the number of multiplications made by this algorithm and solve it. c. Set up a recurrence relation for the number of additions/subtractions made by this algorithm and solve it./n9. Consider the following recursive algorithm. ALGORITHM Riddle(A[0..n-1]) //Input: An array A[0..n-1] of real numbers if n = 1 return A[0] else temp← Riddle(A[0..n -2]) if temp ≤ A[n 1] return temp else return A[n - 1] a. What does this algorithm compute? b. Set up a recurrence relation for the algorithm's basic operation count and solve it.See Answer
  • Q13:8. Sort the list E, X, A, M, P, L, E in alphabetical order by selection sort./n11. Sort the list E, X, A, M, P, L, E in alphabetical order by bubble sort.See Answer
  • Q14:1. Find the number of comparisons made by the sentinel version of sequential search a. in the worst case. b. in the average case if the probability of a successful search is p (0 ≤ p ≤ 1).See Answer
  • Q15:Exercise 2: (9+6+5) = 20 1. Describe (in natural language) a more efficient algorithm than the Brute ForceClosest Points(P) to solve the closest-pair problem for n points X1, X2, ..., Xn on the real line? (Hint: sorting can be done in O(n log n) comparisons) 2. Find the convex hulls of the following sets and identify their extreme points (if they have any): a. a line segment b. a square c. the boundary of a square d. a straight line 3. Design a linear-time algorithm to determine two extreme points of the convex hull of a given set of n> 1 points in the plane.See Answer
  • Q16:Exercise 4: 10 Consider the partition problem: given n positive integers, partition them into two disjoint subsets with the same sum of their elements. (Of course, the problem does not always have a/nsolution.) Design an exhaustive-search algorithm for this problem. Try to minil number of subsets the algorithm needs to generate.See Answer
  • Q17:Exercise 5: 10 Explain how exhaustive search can be applied to the sorting problem and determine the efficiency class (complexity) of such an algorithm.See Answer
  • Q18:Exercise 6: Consider an undirected graph. 1. Explain what property of its adjacency matrix indicates that: a) the graph is complete. b) the graph has a loop, i.e., an edge connecting a vertex to itself. c) the graph has an isolated vertex, i.e., a vertex with no edges incident to it. 2. Answer the same questions for the adjacency list representation. ((3+3+3)+(3+3+3))=18See Answer
  • Q19:Problem 3. [10 marks, 1.5 pages] (Dijkstra's algorithm + min-heap) Given a graph as in Fig. 1, we are interested in finding the shortest paths from the source a to all other vertices using the Dijkstra's algorithm and a min-heap as a priority queue. Note that a min-heap is the same as a max-heap, except that the key stored at a parent node is required to be smaller than or equal to the keys stored at its two child nodes. In the context of the Dijkstra's algorithm, a node in the min-heap tree has the format v( p., d.), where d, is the length of the current shortest path from the source to v and p, is the second to last node along that part (right before v). For example, c(a, 1) is one such node. We treat d, as the key of Node v in the heap, where v = (a, b, c, d, e, f, g, h}. Source 15 10 Figure 1: An input graph for the Dijkstra's algorithm. Edge weights are given as integers next to the edges. For example, the weight of the edge (a, b) is 7. d(a, 5) a) [1 mark] The min-heap after a(a,0) is removed is given in Fig. 2. The next node to be removed from the heap is c(a, 1). Draw the heap after c(a, 1) has been removed and the tree has been heapified, assuming that ∞ ∞ (note: no need to swap if both parent and children are ∞o). No intermediate steps are required. c(0, 1) ) h(-, ∞) b(a, 7) e(-, ∞) f(-∞) g(-, ∞) Figure 2: The min-heap (priority queue) after a(a,0) has been removed. b) [2 marks] Draw the heap(s) after each neighbour of c has been updated and the tree has been heapified (see the pseudocode in the lecture Slide 30, Week 9). If there are multiple updates then draw multiple heaps, each of which is obtained after one update. Note that neighbours are updated in the alphabetical order, e.g., d must be updated before e. No intermediate steps, i.e., swaps, are required./nS: vertices whose shortest paths have been known 1 a(a,0) 2 a(a,0), c(a, 1) 3 4 5 6 7 8 c) [5 marks] Complete Table 1 with correct answers. You are required to follow strictly the steps in the Dijkstra's algorithm taught in the lecture of Week 9. a b d) [2 marks] Fill Table 2 with the shortest paths AND the corresponding distances from a to ALL other vertices in the format a →? →? →v|d, for instance, a → c | 1. Shortest Paths Distances a → a C d Priority queue of remaining vertices b(a,7), c(a,1), d(a,5), e(−,∞), ƒ (−,∞), g(−,∞), h(−,∞) e f 9 h Table 1: Complete this table for Part c. a → c Table 2: Complete this table for Part d. 0 1See Answer
  • Q20:Problem 5 (5 marks, 2 pages). Research a well-known problem of your own interest in any field (science, engineering, technology) that can be solved by a computer algorithm. Write a 1- to 2-page report on a popular algorithm that solves that particular problem and include in your report: (1) a problem description and why it is important and/or interesting, (2) the algorithm description, (3) a pseudocode, (4) a demonstration on a toy example, and (5) a complexity analysis. You could include a few (1-5) references that you used when researching the problem/algorithm, but the writing should be your own. A similarity score of 25% and above between your report and any existing source may indicate plagiarism. The report should be typed in a text editor, e.g., words or Latex, and not handwritten. Marks will be decided based on the correctness, clarity, and the sophistication of the problem/algorithm discussed. A report that is not well written or about a trivial/straightforward problem/algorithm will receive a low mark. Note that the problem/algorithm should NOT be among those already discussed in the pre-recorded lectures/workshops. If you present a problem/algorithm that has been discussed in the lectures/workshops, you will get a zero mark for Problem 5. You could start from our textbook or check the following list from Wiki for a start. https://en.wikipedia.org/wiki/List_of_algorithmsSee Answer

TutorBin Testimonials

I found TutorBin Design And Analysis Of Algorithms homework help when I was struggling with complex concepts. Experts provided step-wise explanations and examples to help me understand concepts clearly.

Rick Jordon

5

TutorBin experts resolve your doubts without making you wait for long. Their experts are responsive & available 24/7 whenever you need Design And Analysis Of Algorithms subject guidance.

Andrea Jacobs

5

I trust TutorBin for assisting me in completing Design And Analysis Of Algorithms assignments with quality and 100% accuracy. Experts are polite, listen to my problems, and have extensive experience in their domain.

Lilian King

5

I got my Design And Analysis Of Algorithms homework done on time. My assignment is proofread and edited by professionals. Got zero plagiarism as experts developed my assignment from scratch. Feel relieved and super excited.

Joey Dip

5

TutorBin helping students around the globe

TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.