subject

Given a list of randomly arranged numbers, for example (6,2,9,5,8,7). Find the total number of upturns in such list. If (a list[b]), then the pair (a, b) is called an upturn of

the list. In the given example, (6,2), (6,5), (9,5), (9,8), (9,7), (8,7) are of possible upturns that

meet the conditions and hence there are 6 upturns in such list.

a) Design a brute-force algorithm to return the number of possible upturns, and analyse

the complexity of your solution (5 marks)

b) Design a more efficient algorithm to do the same task with less complexity, and analyse

the complexity of your solution. (15 marks)

[Important instruction to be followed: Create an arbitrary unsorted list of 6 numbers

and use it to provide full explanation of how your proposed algorithm should work

step by step]

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
Ted wants to go out to a neighborhood park and shoot pictures of dew drops on grass. he wants to get a low-level angle of the dew drops. which support equipment should ted use? a. mini tripod b. pistol grip c. monopod d. body mount
Answers: 2
question
Computers and Technology, 21.06.2019 23:00
Fast sportcars the top speeds of sportscars, given in miles per hour, are: 155 mph bmw m5 217 mph lamborghini aventador spyder 205 mph ferrari 488 205 mph nissan gtr 197 mph chevrolet corvette stingray zr1 258 mph bugatti veyron supersport 195 mph dodge viper 270 mph hennessey venom 155 mph bmw m3 195 mph mercedes sl given: topspeeds=[155; 217; 205; 205; 197; 258; 195; 270; 155; 195]; carnames=string(["bmw m5" "lamborghini aventador spyder" "ferrari 488" "nissan gtr" "chevrolet corvette stingray zr1" "bugatti veyron supersport" "dodge viper" "hennessey venom" "bmw m3" "mercedes sl"]); the variable is a rectangular array. write a function called selectcars to identify cars with the top speed within a given range, and display the identified names. the selected cars speed will be in a range given by lowerbound < speed < upperbound. inputs to the function selectcars are: a column array os all car top speeds named topspeeds, the corresponding chara
Answers: 2
question
Computers and Technology, 24.06.2019 12:40
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
question
Computers and Technology, 24.06.2019 18:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 1
You know the right answer?
Given a list of randomly arranged numbers, for example (6,2,9,5,8,7). Find the total number of uptu...
Questions
question
Social Studies, 02.08.2019 10:30
Questions on the website: 13722363