subject

Imagine we have a list of instances of OnlineOrder, called orders. There are various functions and algorithms we could run on it. Here's one such algorithm. This algorithm retrieves the total cost of the first order in the list. Note that if relevant, you may assume that all orde in orders have around the same number of items.
1 det et first order total orders
What is the running time of this algorithm in terms of Big O notation?
O(1) constant order O(n)
linear order (nº)
quadratic order (12)
polynomial (cubic, specifically) order
O(2) exponential order O(log(n))
logarithmic order
Imagine we have a list of instances of OnlineOrder, called orders. There are various functions and algorithms we could run on it.
Here's one such algorithm. This algorithm finds the total cost of orders in the list. Note that if relevant, you may assume that all or have around the same number of items.
1 def get all order totals(orders):
2 total = 0.0
3 for order in orders:
4 total + order. get order total) Si
5 return total
What is the running time of this algorithm in terms of Big O notation?
O(1), constant order (n)
linear order (n2)
quadratic order (nº)
polynomial (cubic, specifically) order 0
O(2), exponential order (log (n))
logarithmic order 0.0/1.0 point
Imagine we have a list of instances of OnlineOrder, called orders. There are various functions and algorithms we could run on it.
Here's one such algorithm. This algorithm searches for an order with a giverr order number, and returns the index of where it is found. If it is found, it returns - 1. This is implemented with binary search, and we assume that orders is sorted from lowest order number to highest. Note if relevant, you may assume that all orders in orders have around the same number of items.
1) def search orders (orders, search number);
2) win = 0
3) nas n lentorders) 1
4) while in <-
5) current_middle (winna) // 2
6) If orders (current middlel on search numbers
7) return current middle
8) elif search number orders current siddle. order Numbers -
9) Max current siddle 1
10) else:
11) min = current middle an
12) return -1
What is the running time of this algorithm in terms of Big O notation?
O(1), constant order O(n)
linear order O(nº)
quadratic order On
polynomial (cubic, specifically) order 0
O(2), exponential order (log(n))
logarithmic order

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
The ieee 802.11: defines standards for wireless local area network (wlan) communication protocols. identifies various computers or devices connected to a network. verifies any resource attached to another computer on a network that is different from the computer to which the user is logged on. connects multiple local area networks (lans) and wide area networks (wans).
Answers: 2
You know the right answer?
Imagine we have a list of instances of OnlineOrder, called orders. There are various functions and a...
Questions
question
History, 20.10.2021 22:40
question
Mathematics, 20.10.2021 22:40
question
Mathematics, 20.10.2021 22:40
Questions on the website: 13722360