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

If a bubble sort is used to arrange the numbers 7 5 3 9 2 6 in ascending order.

ID: 3777884 • Letter: I

Question

If a bubble sort is used to arrange the numbers 7 5 3 9 2 6 in ascending order. What order will the data be in after the first pass? 2 4 2 9 7 6 5 7 3 9 2 6 5 3 7 2 6 9 2 3 5 6 7 9 None of these A binary search begins by examining the ____________ element of an array. first last largest middle smallest A(n) ________ search is more efficient than a(n) ___ search string, double integer, double binary, linear linear, binary None of these. All searches are equally efficient. If the item being searched for is not in the a array, binary search stops blocking for it and reports that it is not there when array index first > array index last. Boolean variable found equals false. Boolean variable found equals true. It finds a value larger than the search key. It has examined all the elements in the array.

Explanation / Answer

Question 5

if a bubble sort is used to arrange the number 7 5 3 9 2 6 in ascending order, what order will be the data be in after the first place.

Answer- option c--5 3 7 2 6 9
Explanation
   7 5 3 9 2 6-->5 7 3 9 2 6-- since 7>5 swap it
   5 7 3 9 2 6-->5 3 7 9 2 6-- since 7>3 swap it
   5 3 7 9 2 6-->5 3 7 9 2 6-- since 7<9 dont swap
   5 3 7 9 2 6-->5 3 7 2 9 6-- since 9>2 swap it
   5 3 7 2 9 6-->5 3 7 2 6 9-- since 9>6 swap it


Question 6

A Binary search begins by examining the __________ element of an array

Answer- middle
Explanation
   Binary search starts searching from its root element

Question 7

A(n) __________ search is more efficient than a(n) __________ search

Answer- binary , linear
Explanation
   in linear search, element is searched one by one in linear order, which gives the complexity as O(n). Whereas in binary search start with the middle of a sorted list which gives the complexity is O(logn)


Question 8

if the item, being searched for is not in the array, binary search stops looking for it and reports that it is not there when

Answer- it finds a value larger than search key
Explanation:
   Since the BST is a sorted one. Hence it will start looking for the element from the middle. if the item being searched is less than the middle element than look for the left sub tree. else move towards the right tree. Hence when we find the element larger than the searched key and still didnot find it. it stops looking for the element

NOTE: feel free to ask question. God bless you!!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote