OCR Computer Science for A Level Teaching and Learning Resources Chapter 1: Computational thinking ANSWERS TO QUESTIONS IN THE STUDENT’S BOOK Page 15 Question Think of some other techniques from computer science that translate into real-world problem solving. Answer Looking up a name in a directory – linear search/binary search. Standing in a queue waiting to be served – data structures. Packing your bags for a trip – prefetching, caching. Planning a route – shortest-path algorithm. Cooking a gourmet meal – parallel processing. Cleaning out your garage – keep only what you need. Storing books, box sets, etc. – hashing. Page 17 Question Consider the advantages of each level of detail given in this example. When would you use each? Answer Consider factors such as preferred method of travel, cost, time requirements, etc. Question A decimal number such as 21 can be decomposed into its separate digits; that is, 2 × 101 + 1 ×100. 1. Decompose the binary number 1000001. Answer 26 + 20 Question 2. Decompose the decimal equivalent of binary 1000001. Answer 6 × 101 + 5 × 100 Question 3. Decompose the hexadecimal decimal equivalent of binary 1000001. Answer 4 × 161 + 1 × 160 OCR Computer Science for A Level Chapter 1 © Hodder & Stoughton Limited 2015 OCR Computer Science for A Level Teaching and Learning Resources Page 19 Question What is the end condition in the binary search implementation given on this page? Answer if (high < low) Page 20 Question 1. Define the term ‘recursion’. Answer Defining an object in terms of itself. It often refers to a function or procedure calling itself from within the subprogram. Question 2. GNU is an operating system. Explain why the name GNU is recursive. Answer The ‘G’ in ‘GNU’ refers to ‘GNU’ itself. It stands for GNU not Unix. Question 3. A library accepts new members and stores data about them. It issues them with a card. It also updates membership details when necessary. When the member leaves, the record for that member is deleted. Express this library system as a data-flow diagram. OCR Computer Science for A Level Chapter 1 © Hodder & Stoughton Limited 2015 OCR Computer Science for A Level Teaching and Learning Resources Answer OCR Computer Science for A Level Chapter 1 © Hodder & Stoughton Limited 2015