Page 124 - Computer science 868 Class 12
P. 124

1      2      3           3     2      1
                                              4      5      6           6     5      4
                                              7      8      9           9     8      7
                                              10     11    12          12     11     10
                                                Original matrix           Mirror matrix

                 17.  Write an algorithm to check if a given matrix is a unit matrix or not. A unit matrix is a matrix in which all the principle diagonal
                    elements are equal to 1 and the remaining elements are zero. Assume the matrix is already created. Some examples of the Unit
                    matrix are given below.
                                              1      0     0          1    0     0    0
                                              0      1     0          0    1     0    0
                                              0      0     1          0    0     1    0
                                              3 × 3 Unit matrix       0    0     0    1
                                                                        4 × 4 Unit matrix

                 18.  Write an algorithm to enter any sentence and print the words starting with vowels.
                    For example, if the sentence is: AN APPLE A DAY KEEP DOCTORS AWAY will print the words AN, APPLE, A, AWAY
                 19.  Write an algorithm to enter any word in upper-case and arrange it in ascending order of the alphabets without using any standard
                    sorting technique.
                    For example, the word MANGO will be rearranged to AGMNO.
                 20.  Write an algorithm to accept a word in upper-case and check whether it is a palindrome or not. A palindrome is a word that reads
                    the same from both ends. For example, MADAM, NOON, MALAYALAM, etc.
                 21.  Write an algorithm using the recursive technique to print the highest digit of a number using the method highest (number, high).
                 22.  Write a recursive algorithm to convert a binary number to its decimal equivalent using procedure decimal (binary, position).
                 23.  Write a recursive algorithm to check if a given number is an automorphic number or not. An automorphic number is the one that
                    exists at the end of its square.
                    Example:  5  = 25. And 25 ends with 5.
                             2
                             2
                            6  = 36 and 6 is present at its end.
                              2
                            25  is 625 and 625 has 25 at its end.
                 24.  Write an algorithm to insert any node in position ‘p’ of a linked list where p>1 and p<size of the linked list where ‘p’ is not the first
                    or last node.
                 25.  Write an algorithm to implement the operations of a stack using a linked list.
                 26.  Write an algorithm to implement the operations of a queue using a linked list.
                 27.  Write an algorithm to split a linked list into two linked lists starting from a given position ‘p’.
                 28.  Write an algorithm to reverse a linked list.

              D.  Assertion and Reasoning Based Question.
                 Assertion: In flowchart, the symbol of process box is diamond shape.
                 Reason: The process box is used to represent arithmetic or assignment operations carried out internally.
                 (a)  Both Assertion and Reason are true, and Reason is the correct explanation for Assertion.
                 (b)  Both Assertion and Reason are true, but Reason is not the correct explanation for Assertion.
                 (c)  Assertion is true and Reason is false.
                 (d)  Assertion is false and Reason is true.

                                          Previous Years' Questions


                  1. A square matrix A[m][m] is stored in the memory Row Major wise with each element requiring 2 bytes of storage. If the base
                    address at A[1][0] is 1020 and the address at A[4][3] is 1056, then the order of the matrix A[m][m] will be:   [ISC 2022]
                    (a)  [6][6]                                          (b)  [4][4]
                    (c)  [5][5]                                          (d)  [3][3]
                Ans. (c)


                122122  Touchpad Computer Science-XII
   119   120   121   122   123   124   125   126   127   128   129