prutor.ai PYTHON QUIZ 10 ANSWERS

prutor.ai PYTHON quiz 10 answer:-

this blog is only knowledge purpose and help for needy  nothing other reason.

Q1:-In a binary search algorithm which is the worst case scenario?

1.
2.
3.
4.

Ans:-{ (2) Olog(n)}

reason:- his means that at each step in a lookup, you either (1) find the node that you're looking for, or (2) toss out half the nodes in the tree.That means that the lookup time gets up to O(n) in the worst case, since the number of times you can subtract a constant from n is O(n)

Q2:-which statement is correct in case of Tower of Hanoi?

1.
2.
3.
4.
Ans:-(2) only one disk can move at a time)
reason:- The statement "Only one disk can be moved at a time" is correct in case of tower of hanoi. The Tower of Hanoi or Luca's tower is a mathematical puzzle consisting of three rods and numerous disks. The player needs to stack the entire disks onto another rod abiding by the rules of the game.

Q3:-how many swap will be performed in selection sort in worst case?

1.
2.
3.
4.

Ans:-(3) (n-1)

Reason:-The time efficiency of selection sort is quadratic, so there are a number of sorting techniques which have better time complexity than selection sort. One thing which distinguishes selection sort from other sorting algorithms is that it makes the minimum possible number of swaps, n − 1 in the worst case.

Q4:-which of the following is true for binary search algorithm?
1.
2.
3.
4.
Ans:-(3) (If there are two numbers equals to the search item ( number to be searched ), it can pick anyone depending on the implementation).

Reason:-because The list of data must be in a sorted order for it to work. A binary search works by finding the middle element of a sorted array and comparing it to your target element.so two numbers equals to the search item ( number to be searched ), it can pick anyone depending on the implementation). 

Q5:-which of the following statement is true for recursion?

1.
2.
3.
4.

Ans:-{(3) both 1 and 2}

Reason:-An infinite loop occurs when a condition always evaluates to true. Usually, this is an error. For example, you might have a loop that decrements until it reaches 0 and Every recursive function must have at least one base case.

                                                                                                                                                    
warning:- please dont copy past as it is otherwise you'll quiz mark UFM. CHANGE some word or paragraph and write own word. any other help please comment me.

No comments:

Post a Comment

computer system security quiz 10 Answers

computer system security quiz 10 Answers | css quiz 10 ( all question and answer only for eduction purpose. )   Q:1. Which of the following ...