Exercise 11.2 Class 9 - NCERT Solutions for Chapter 11 Ganita Manjari - Exercise Set 11.2

part 2 - Ex 11.2, 1 - Exercise Set 11.2 - Chapter 11 Class 9 - The World of Algorithms (Ganita Manjari) - Maths Class 9

part 3 - Ex 11.2, 1 - Exercise Set 11.2 - Chapter 11 Class 9 - The World of Algorithms (Ganita Manjari) - Maths Class 9

part 4 - Ex 11.2, 1 - Exercise Set 11.2 - Chapter 11 Class 9 - The World of Algorithms (Ganita Manjari) - Maths Class 9

Remove Ads
Teachoo · Class 9 Explore Class 9

Transcript

Ex 11.2, 1 (i) Suppose List 1 and List 2 are two lists of numbers in increasing order. (i) Write an algorithm to find elements in List 1 that are not present in List 2. We must keep an entry only when it belongs to the first list and is absent from the second. Algorithm Start with an empty list only-in-list-1 For each number x in List 1 If x does not appear in List 2, add x to the end of only-in-list-1 Report only-in-list-1 Example Let List 1 = [1, 2, 3, 6, 9, 18] List 2 = [1, 2, 3, 4, 6, 12] Therefore, only-in-list-1 = [9, 18] Entry from List 1 | Is it present in List 2? | only-in-list-1 1 | Yes | [] 2 | Yes | [] 3 | Yes | [] 6 | Yes | [] 9 | No | [9,] 18 | No | [9, 18] Ex 11.2, 1 (ii) Suppose List 1 and List 2 are two lists of numbers in increasing order. (ii) Write an algorithm to find elements in List 2 that are not present in List 1. We must keep an entry only when it belongs to the second list and is absent from the first. Algorithm Start with an empty list only-in-list-2 For each number x in List 2 If x does not appear in List 2, add x to the end of only-in-list-2 Report only-in-list-2 Example Let List 1 = [1, 2, 3, 6, 9, 18] List 2 = [1, 2, 3, 4, 6, 12] Therefore, only-in-list-2 = [4, 12] Entry from List 2 | Is it present in List 1? | only-in-list-2 1 | Yes | [] 2 | Yes | [] 3 | Yes | [] 4 | No | [4,] 6 | Yes | [4,] 12 | No | [4, 12]

CA Maninder Singh's photo - Co-founder, Teachoo

Made by

CA Maninder Singh

CA Maninder Singh is a Chartered Accountant qualified since 2010 and an educator teaching since 2006. At Teachoo, he draws on his accounting and tax experience to explain Accounts, Income Tax and GST through step-by-step lessons and practical examples.

For an uninterrupted learning experience, students can use Teachoo Black to remove ads and focus better.