![emma042902](/avatars/15214.jpg)
emma042902
08.12.2020 •
Computers and Technology
Let us consider an array a[1...n] with integer values (both positive and negative). Choose three different sorting methods to sort increasingly the array. Which sorting method is the fastest (from the three chosen methods)? Analyze the complexity (problem size, dominant operation and complexity) of the three algorithms in order to prove your answer. (1p)
Now that your array a[1...n] is sorted increasingly, consider a value v and using an algorithm with complexity 0(lgn), determine the position where this value can be inserted such that the array remains increasingly sorted. Prove the total correctness of your algorithm (use an invariant). (1p)
Consider another increasingly sorted array b[1...m]. So now you have a[1...n] and b[1...m] with elements not necessarily distinct.
a. Construct a strictly increasingly sorted array with the distinct elements from a and b. Analyze the complexity (problem size, dominant operation and complexity) of your algorithm. (0.5p)
b. Propose an algorithm with linear complexity to determine the set with common elements of the two arrays a and b. Analyze the complexity (problem size, dominant operation and complexity) of your algorithm. (0.5p)
Indications:
All the algorithms will be written in pseudocode.
Solved
Show answers
More tips
- F Family and Home Parents or Environment: Who Has the Most Influence on a Child s Upbringing?...
- P Philosophy Unbelievable stories of encounters with otherworldly forces...
- L Leisure and Entertainment How to Choose the Perfect Gift for Men on February 23rd?...
- H Health and Medicine How to Treat Whooping Cough in Children?...
- H Health and Medicine Simple Ways to Lower Cholesterol in the Blood: Tips and Tricks...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
- S Style and Beauty Intimate Haircut: The Reasons, Popularity, and Risks...
- A Art and Culture When Will Eurovision 2011 Take Place?...
- S Style and Beauty How to Choose the Perfect Hair Straightener?...
Answers on questions: Computers and Technology
- C Computers and Technology Answer below questions and it should me in your own words . no plagiarism. 1 provide a brief definition of network access control. 2 what is an eap? 3 list and briefly...
- C Computers and Technology Match the correct term from the list below with the correct statement....
- C Computers and Technology And he wants to create a document by typing in a few paragraphs of text into his computer he needs to use a pointy device to click approximate buttons do you run the text...
- C Computers and Technology 1.)Name at least five things that are easier to do with fast internet access. 2.)If you had online homework, but did not have a computer, how would you go about completing...
- E English Read any book you want and Describe an interesting or important character in your book. (5 sentences and ill give brainliest)...
- P Physics On lance un ballon de football pesant 0,50 kg d une hauteur de 1,8 m avec une vitesse vectorielle initiale de 15,0 m/s [vers la droite 34° vers le haut, ou 34° sur l horizontale)....
- M Mathematics In 2 Thessalonians the church was under the misconception that...
- E English Write a short paragraph about the memorable things that you used to do in your elementary days. Use the past real conditional....
- M Mathematics I spent $120 shopping for food last week. This week I spent 12% more. Which expression could be used to find how much I spent on food this week?...
- S Social Studies Why were the black cowboys of texas treated better on the range than anywhere else?...
Ответ: