In: Computer Science
For the following, copy the questions into a text file and write your answers for each question.
I. Place the following algorithm time complexities in order from
fastest (least number of comparisons) to the slowest: nlogn, n, n2,
2n, logn, 2n
II. In your own words, explain the two characteristics that a
recursive solution must have.
III. Why are divide-and-conquer algorithms often very efficient in
terms of time complexity?
IV. Write in your own words 3 different examples of cases where
people around you are giving up their privacy to use some service
in exchange for a benefit. State for each example what data is
being collected and what benefits the user receives in
exchange.
I. Place the following algorithm time complexities in order from fastest (least number of comparisons) to the slowest: nlogn, n, n2, 2n, logn, 2n
logn,n, nlogn, 2n, n2
In your own words, explain the two characteristics that a recursive solution must have.
1. It must call itself at least 1 time to satisfy the recursive approach
2. It value should be changed leads to it base value means if the factorial program in recursive solution if you enter any number it will repeatedly call the fuction until input value become 1 that is recursive call run until the base value is achieved
Why are divide-and-conquer algorithms often very efficient in terms of time complexity?
DIvide and conquer is very efficient in tems of time complexity because you divide the problem into subparts and solve it separatey which is knows as conquer after getting the solution your merge the all solution into one optimal solution that is known as combine which reduce the no of operation to a much extent . ex of this is quicksort and binary search
Write in your own words 3 different examples of cases where people around you are giving up their privacy to use some service in exchange for a benefit. State for each example what data is being collected and what benefits the user receives in exchange.
1. Cookies Many websites showing a prompt that they are using the cookies please accept the cookies and people accept these cookies withour considering that they are giving up their privacy to use some service offered by the sites cookies are nothing a file that contains or preserve your session for further use means if you login to any site if they offer you the cookies means the next you open the site you will login directly using cookies without entering the credentials
2. Web activity control The user generally allows the sites to collect, manage and see their web activity in this condition user almost loose it most of the privacy like whaterver he is browsing or searching on the internet the data is directly send to that sites in exchage these site offers your desire content in the form of ads or your improving your general feed means if you are search to buy a laptop it will be monitor by these sites they will start show the content related to laptop in the form ads
3. Contact sync you generally any application you download in your phone most of the application wants to access your calls logs and contacts and many people allow these things normally by this these application developers may sync your contact for their personal benifit and in exchange they provide you the better user experience like direct sharing etc
Please hit the like button if you find this helpful for you THANK YOU AND HAPPY LEARNING:)