![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 15.04.2020 22:08, Arealbot
What are the Big-Oh and Tilde orders of the following code fragment? The fragment is parametrized on the variable n. Assume that you are measuring the number of swap calls. [10 points] public s tat ic void s o r t (Comparable [ ] a ) { int n = a . l eng th ; for ( int j = 0 ; j < n1; j++) { int z = j ; for ( int i = j +1; i < n ; i++) { i f ( a [ i ] < a [ z ] ) { z = i ; } } i f ( z != j ) { swap ( a [ j ] , a [ z ] ) ; // count t h e s e } } } (a) What is the Big-Oh order of the above code fragment? If it does not exist, then explain. (b) What is the Tilde order of the above code fragment? If it does not exist, then explain.
![answer](/tpl/images/cats/otvet.png)
Answers: 1
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 08:30, colebuug9
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
Do you know the correct answer?
What are the Big-Oh and Tilde orders of the following code fragment? The fragment is parametrized on...
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
Mathematics, 14.10.2019 18:30
![Konu](/tpl/images/cats/ap.png)
![Konu](/tpl/images/cats/geografiya.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 14.10.2019 18:30
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/geografiya.png)
![Konu](/tpl/images/cats/mat.png)