Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Selection sort starts at the beginning of the list and compares pairs of data

ID: 3669435 • Letter: 1

Question

1. Selection sort starts at the beginning of the list and compares pairs of data items as it moves down to the end. A. True B. False
2. Bubble sort is ____. A. O(n2) B. O(log2n) C. O(n) D. O(1)
3. In a ____ complexity algorithm, when the problem doubles in size, the amount of work only increases by 1. A. quadratic B. polynomial C. logarithmic D. constant
4. The performance of some algorithms depends on the placement of the data that are processed. A. True B. False
5. One way to measure the time cost of an algorithm is to use ____ to obtain an actual run time. A. an escrow B. a timer C. the computer’s clock D. a time server
6. One notation that computer scientists use to express the efficiency or computational complexity of an algorithm is called big-____ notation. A. O B. P C. C D. G
7. In asymptotic analysis, the value of a polynomial asymptotically approaches or approximates the value of its largest term as n becomes very large. A. True B. False
8. List indexing is a good example of a ____-time algorithm. A. quadratic B. linear C. logarithmic D. constant
9. When you count instructions to estimate the efficiency of an algorithm, you count the instructions in the executable machine language program. A. True B. False
10. Logarithmic complexity is better than constant but worse than linear complexity. A. True B. False
1. Selection sort starts at the beginning of the list and compares pairs of data items as it moves down to the end. A. True B. False
2. Bubble sort is ____. A. O(n2) B. O(log2n) C. O(n) D. O(1)
3. In a ____ complexity algorithm, when the problem doubles in size, the amount of work only increases by 1. A. quadratic B. polynomial C. logarithmic D. constant
4. The performance of some algorithms depends on the placement of the data that are processed. A. True B. False
5. One way to measure the time cost of an algorithm is to use ____ to obtain an actual run time. A. an escrow B. a timer C. the computer’s clock D. a time server
6. One notation that computer scientists use to express the efficiency or computational complexity of an algorithm is called big-____ notation. A. O B. P C. C D. G
7. In asymptotic analysis, the value of a polynomial asymptotically approaches or approximates the value of its largest term as n becomes very large. A. True B. False
8. List indexing is a good example of a ____-time algorithm. A. quadratic B. linear C. logarithmic D. constant
9. When you count instructions to estimate the efficiency of an algorithm, you count the instructions in the executable machine language program. A. True B. False
10. Logarithmic complexity is better than constant but worse than linear complexity. A. True B. False
1. Selection sort starts at the beginning of the list and compares pairs of data items as it moves down to the end. A. True B. False
2. Bubble sort is ____. A. O(n2) B. O(log2n) C. O(n) D. O(1)
3. In a ____ complexity algorithm, when the problem doubles in size, the amount of work only increases by 1. A. quadratic B. polynomial C. logarithmic D. constant
4. The performance of some algorithms depends on the placement of the data that are processed. A. True B. False
5. One way to measure the time cost of an algorithm is to use ____ to obtain an actual run time. A. an escrow B. a timer C. the computer’s clock D. a time server
6. One notation that computer scientists use to express the efficiency or computational complexity of an algorithm is called big-____ notation. A. O B. P C. C D. G
7. In asymptotic analysis, the value of a polynomial asymptotically approaches or approximates the value of its largest term as n becomes very large. A. True B. False
8. List indexing is a good example of a ____-time algorithm. A. quadratic B. linear C. logarithmic D. constant
9. When you count instructions to estimate the efficiency of an algorithm, you count the instructions in the executable machine language program. A. True B. False
10. Logarithmic complexity is better than constant but worse than linear complexity. A. True B. False

Explanation / Answer

1.            Selection sort starts at the beginning of the list and compares pairs of data items as it moves down to the end.

A.            True

B.            False

Ans: A. True. Because it picks first element and compare with th enext one. If 2nd element is less than first one then it swaps both number, if it's not less then it compares first element with 3rd then 4th to nth element.

2.            Bubble sort is ____.

A.            O(n2)

B.            O(log2n)

C.            O(n)

D.           O(1)

Ans: A. O(n2). Because it has two loop is nested order and both the loop runs n times. I.e for each element of outer loop inner loop runs for n times. So, for n elements of outer loop inner loops runs n*n = n^2 times. Hence, the complexity is O(n^2)

3.            In a ____ complexity algorithm, when the problem doubles in size, the amount of work only increases by 1.

A.            quadratic

B.            polynomial

C.            logarithmic

D.           constant

Ans: B.. logarithmic. Because by the definition of logarithm it is the inverse operation to exponentiation. So if input size dubled, amount of work increases by 1.

4.            The performance of some algorithms depends on the placement of the data that are processed.

A.            True

B.            False

Ans: B: False. Performance of algorithm don't depends on placement of data. It depends on size of the data. Because more the data in size more the time required to process the data.

5.            One way to measure the time cost of an algorithm is to use ____ to obtain an actual run time.

A.            an escrow

B.            a timer

C.            the computer’s clock

D.           a time server

Ans: C. The Computer’s clock. Because execution of instruction of a computer depends upon computer's clock cycle. It is not measurable by a timer or a time server or any other such things. Those timeframe are to big to precisely calculate the time needed to execute a program. Whether, computer's clock produce time in microsecond time quantum which is appropriate to measure time needed to execute a instruction because a instruction could finish execution in couple of microseconds or some time even in a single microsecond.

6.            One notation that computer scientists use to express the efficiency or computational complexity of an algorithm is called big-____ notation.

A.            O

B.            P

C.            C

D.           G

Ans: A. O. O notation pronunced as big oh notation is most used and prefered method to express the time complexity of a algorithm.

7.            In asymptotic analysis, the value of a polynomial asymptotically approaches or approximates the value of its largest term as n becomes very large.

A.            True

B.            False

Ans> A. True. The more value n increases the more percentage of total value of polynomial is contributed by the largest term of the polynomial.

8.            List indexing is a good example of a ____-time algorithm.

A.            quadratic

B.            linear

C.            logarithmic

D.           constant

Ans. B. linear. Because to traversal of list starts for start of list and proceed to the end until it finds the desired term. So the maximum number of time the program can run to find the expected element for n number of element is n. Hence complexity is linear.

9.            When you count instructions to estimate the efficiency of an algorithm, you count the instructions in the executable machine language program.

A.            True

B.            False

Ans. B. False. There is nothing to do with machine language program to estimate the efficiency of an algorithm. All you need to calculate the highest possible number instruction would runs against a large number of inputs.

10.          Logarithmic complexity is better than constant but worse than linear complexity.

A.            True

B.            False

Ans. B. False. For operations like sorting or scanning every element of a simple collection, you can make a hard lower bound of the number of elements in the collection for those operations, because the output depends on every element of the input. [1] Thus, O(n) or O(n*log(n)) are the best one can do.

For other kinds of operations, like accessing a single element of a hash table or linked list, or searching in a sorted set, the algorithm needn't examine all of the input. In those settings, an O(n) operation would be dreadfully slow.

Please leave a comment if you need an explaination of any of above answer. I'll be happy to explain.