Question 2
OCR Computer Science June 2025 Algorithms and programming (H446-02)A level14 marks
On the specification
- (a)
- 2.3 Algorithms
- (b)(i)
- 1.3 Exchanging data
- (b)(ii)
- 1.3 Exchanging data
Question text
2* A shopping website requires customers to create a username and password. (a) The usernames and passwords are stored securely in a file. The file contains the username and passwords for 50 million users which are sorted in alphabetical order by username. The file can be searched using a linear search or a binary search. The big-O complexities for a linear search and a binary search are given in the table: Search Worst-case Average-case Worst-case algorithm time time space Linear O(n) O(n) O(1) Binary O(log n) O(log n) O(1) Compare the use of a linear search and a binary search in this scenario. You should include the following in your answer: • the features and preconditions of a linear and binary search • the benefits and drawbacks of each search in this scenario • a conclusion justifying which search algorithm should be used in this scenario. You should make reference to the big-O complexities in your answer. [9] (b) The website collects data from customers’ activities once they log on. For example, the items they view and purchase. The company that owns the website would like to use data mining to improve their website and customer experience. (i) Describe what data mining means. [3] (ii) Explain how the company can make use of data mining to improve their website and customer experience. [2]