Latest Post

6/recent/ticker-posts

CS201 GDB 1 Solution Fall 2022

CS201 GDB 1 Solution Fall 2022: Today we are sharing with cs201 gdb 1 solution semester fall 2022. Before creating your assignment or gdb file please read all the instructions carefully and follow all the rules.

CS201 gdb 1 solution fall 2022

GDB Topic: 

Suppose an XYZ university has conducted a test and a total of 100 students have participated in that test. After the test is conducted, the university decided to show the performance (marks) of the students on its system web portal in an order such that highest marks student will be displayed at the top followed by the second highest marks student and so on up to the lowest marks student.

Now suppose the university has hired you as a C++ programmer and has assigned you the task to write a computer program which does the finding/searching based on marks in the stored data. The university has limited resources and wants to find the speed up process for searching. Which searching algorithm (Linear or Binary) will be the most suitable to use in your program for the above task. Justify your answer in either case with proper reasoning.

Solution File:

According to the given scenario Binary search is most suitable for an XYZ university.

For Solution File Click here

Because:

In binary search method, the element that has to be searched is compared to the array middle element. Search is considered successful only if it matches the target. The binary search is used divide and conquer approach, it does not scan every element in the list, it only searches half of the list instead of going through each element. Binary search performs ordering comparisons whereas Linear search performs equality comparison. Binary search is more faster as compare to linear search. Binary search is more efficient than the linear search in the case of large data sets.


Post a Comment

0 Comments