COMPUTER SCIENCE. Paper 1 (THEORY)



Similar documents
COMPUTER SCIENCE 1999 (Delhi Board)

PES Institute of Technology-BSC QUESTION BANK

DATA STRUCTURES USING C

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

Chapter 3: Restricted Structures Page 1

10CS35: Data Structures Using C

Unit Write iterative and recursive C functions to find the greatest common divisor of two integers. [6]

Data Structure [Question Bank]

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

Binary Adders: Half Adders and Full Adders

Boolean Algebra Part 1

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

CSE140: Midterm 1 Solution and Rubric

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Common Data Structures

Masters programmes in Computer Science and Information Systems. Object-Oriented Design and Programming. Sample module entry test xxth December 2013

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Pseudo code Tutorial and Exercises Teacher s Version

Section IV.1: Recursive Algorithms and Recursion Trees

BOOLEAN ALGEBRA & LOGIC GATES

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Algorithms and Data Structures Written Exam Proposed SOLUTION

CHAPTER 3 Boolean Algebra and Digital Logic

Sample Questions Csci 1112 A. Bellaachia

Ordered Lists and Binary Trees

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

Data Structures and Algorithms Written Examination

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Bangalore University B.Sc Computer Science Syllabus ( Semester System)

Algorithms and Data Structures

I PUC - Computer Science. Practical s Syllabus. Contents

Introduction. The Quine-McCluskey Method Handout 5 January 21, CSEE E6861y Prof. Steven Nowick

Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am-12:10pm (180 minutes), Friday, November 12, 2010

AP Computer Science Java Mr. Clausen Program 9A, 9B

CSE140: Components and Design Techniques for Digital Systems

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

Two-level logic using NAND gates

Class XII (Theory) C++

Logic in Computer Science: Logic Gates

Specimen 2015 am/pm Time allowed: 1hr 30mins

Data Structures and Algorithms

AFF 808. Sub. Code 4BIT1C1. B.Sc. DEGREE EXAMINATION, NOVEMBER First Semester. Information Technology

Data Structures Using C++ 2E. Chapter 5 Linked Lists

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Combinational circuits

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

CH3 Boolean Algebra (cont d)

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Handout #1: Mathematical Reasoning

Module 2 Stacks and Queues: Abstract Data Types

12-6 Write a recursive definition of a valid Java identifier (see chapter 2).

Math 115 Spring 2011 Written Homework 5 Solutions

Data Structures. Level 6 C Module Descriptor

Gates, Circuits, and Boolean Algebra

3.Basic Gate Combinations

Simplifying Logic Circuits with Karnaugh Maps

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

Course: Programming II - Abstract Data Types. The ADT Stack. A stack. The ADT Stack and Recursion Slide Number 1

Data Structures and Data Manipulation

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

ML for the Working Programmer

J a v a Quiz (Unit 3, Test 0 Practice)

Efficient Data Structures for Decision Diagrams

AP Computer Science AB Syllabus 1

Introduction to Data Structures

Stacks. Stacks (and Queues) Stacks. q Stack: what is it? q ADT. q Applications. q Implementation(s) CSCU9A3 1

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

MAX = 5 Current = 0 'This will declare an array with 5 elements. Inserting a Value onto the Stack (Push)

7.1 Our Current Model

Offline 1-Minesweeper is NP-complete

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Binary Heap Algorithms

16. Recursion. COMP 110 Prasun Dewan 1. Developing a Recursive Solution

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

Data Structures and Algorithms V Otávio Braga

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

The Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n-1)!

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

CS 3719 (Theory of Computation and Algorithms) Lecture 4

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

AP Computer Science Java Subset

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Mathematical Induction. Lecture 10-11

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Symbol Tables. Introduction

Searching Algorithms

Boolean Algebra. Boolean Algebra. Boolean Algebra. Boolean Algebra

Moving from CS 61A Scheme to CS 61B Java

Laboratory Assignments of OBJECT ORIENTED METHODOLOGY & PROGRAMMING (USING C++) [IT 553]

CmpSci 187: Programming with Data Structures Spring 2015

Transcription:

COMPUTER SCIENCE Paper 1 (THEORY) (Three hours) Maximum Marks: 70 (Candidates are allowed additional 15 minutes for only reading the paper. They must NOT start writing during this time) ----------------------------------------------------------------------------------------------------------------------- Answer all questions in Part I (compulsory) and six questions from Part-II, choosing two questions from Section-A, two from Section-B and two from Section-C. All working, including rough work, should be done on the same sheet as the rest of the answer. The intended marks for questions or parts of questions are given in brackets [ ]. ----------------------------------------------------------------------------------------------------------------------- PART I Answer all questions Question 1 While answering questions in this Part, indicate briefly your working and reasoning, wherever required. (a) State Associative law and prove it with the help of a truth table. [1] (b) Draw the truth table to prove the proportional logic expression. (x => y) ʌ (y => x) = x <=> y (c) Find the dual for the Boolean equation: AB + BC + 1 = 1. [1] (d) Convert the Boolean expression F(X,Y,Z) = X Y Z + X YZ + XYZ into its cardinal form. (e) Minimize F = XY + (XZ) +XY Z using Boolean laws. [1] [1] [1] Question 2 (a) Differentiate between Stack data structure and Queue data structure. [2] (b) Convert the following infix notation to postfix: [2] A * ( B / C ) / E + F (c) Define Interface. How is it different from a Class? [2] 1

(d) (e) Each element of an array arr[15][20] requires W bytes of storage. If the address of arr[6][8] is 4440 and the Base Address at arr[1][1] is 4000, find the width W of each cell in the array arr[ ][ ] when the array is stored as Column Major Wise. Define Big O notation. State the two factors which determine the complexity of an algorithm. [2] [2] Question 3 The following is a function of some class. What will be the output of the function test ( ) when the value of count is equal to 4? Show the dry run / working. void test (int count ) { if ( count = = 0) System.out.println( ); else { System.out.println( Bye + count); test( --count ); System.out.println( + count); } } [5] 2

PART II Answer six questions in this part, choosing two questions from Section A, two from Section B and two from Section C. SECTION - A Answer any two questions. Question 4 (a) Given F(A,B,C,D) = ( 0, 2, 3, 6, 8, 10, 11, 14, 15 ) (i) (ii) Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs). [4] Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1] (b) Given F(P,Q,R,S) = π ( 5, 7, 8, 10, 12, 14, 15 ) (i) (ii) Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs). [4] Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1] Question 5 (a) Draw the logic diagram and truth table to encode the decimal numbers ( 2, 3, 5, 7, 8 ) and briefly explain its working. [5] (b) Simplify the following Boolean expression and draw the gate for the reduced expression. F= A B + AB C + A [2] (c) Define Universal gates. Give one example and show how it works as an OR gate. [3] Question 6 (a) Draw a truth table with a 3 input combination which outputs 1 if there are odd number [5] of 0 s. Also derive an SOP expression for the output. Reduce the expression using Karnaugh Map. (b) Define Proposition. How does tautology differ from contradiction? [2] (c) Briefly explain the working of a 4:1 multiplexer. Also draw the logic diagram of 4:1 multiplexer. [3] 3

SECTION B Answer any two questions Each program should be written in such a way that it clearly depicts the logic of the problem. This can be achieved by using mnemonic names and comments in the program. ( Flowcharts and Algorithms are not required ) The programs must be written in Java. Question 7 [10] A class Composite contains a two dimensional array of order [m x n]. The maximum values possible for both m and n is 20. Design a class Composite to fill the array with the first (m x n) composite numbers in column wise. The details of the members of the class are given below: Class name : Composite Data members /instance variables : arr[ ][ ] : stores the composite numbers column wise m n : integer to store the number of rows : integer to store the number of columns Member functions : Composite(int mm, int nn ) : to initialize the size of the matrix m=mm and n=nn int iscomposite( int p ) : returns 1 if number is composite otherwise returns 0. void fill ( ) : to fill the elements of the array with the first (m n) composite numbers in column wise void display( ) : displays the array in a matrix form. Specify the class Composite giving details of the constructor(int,int), int iscomposite(int), void fill( ) and void display( ). Define a main( ) function to create an object and call the functions accordingly to enable the task. 4

Question 8 [10] Design a class Sort which enables a word to be arranged in alphabetical order. The details of the members of the class are given below : Class name : Sort Data members /instance variables: Str : stores a word len Member functions : Sort( ) void readword( ) void arrange ( ) void display( ) : to store the length of the word : default constructor : to accept the word : to arrange the word in alphabetical order using any standard sorting technique. : displays the original word along with the sorted word Specify the class Sort giving details of the constructor, void readword( ), void arrange( ), and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task. Question 9 [10] A Special number is a number in which the sum of the factorial of its digits is equal to the number. Example: 145 ( 1! + 4! + 5! = 145 ). Thus, 145 is a special number. Design a class Special to check if the given number is a Special number or not. Some of the members of the class are given below: Class name : Special Data members /instance variables : n : integer to store the number Member functions : Special( ) void read( ) int factorial(int x) boolean isspecial( ) void display( ) : default constructor : to accept the number : return the factorial of a number using recursion technique. : checks for the special number by invoking the function factorial( ) and returns true if Special, otherwise returns false : to show the result with an appropriate message. Specify the class Special, giving details of the Constructor, void read( ), int factorial(int), boolean isspecial( ) and void display( ). Define the main() function to create an object and call the member function according to enable the task. 5

SECTION C Answer any two questions Each Program should be written in such a way that it clearly depicts the logic of the problem step wise. This can also be achieved by using comments in the program and mnemonic names or pseudo codes for algorithms. The program must be written in Java and the algorithms must be written in general / standard form, wherever required / specified. (Flowcharts are not required.) Question 10 [5] A super class Account contains employee details and a sub class Simple calculates the employee s simple interest. The details of the two classes are given below: Class name : Account Data Members: Name : stores the employee name Pan : stores the employee PAN number Principal : stores the Principal amount (in decimals) acc_no : stores the employee bank account number Member functions: Account(. ) : parameterized constructor to assign value to data members void display( ) : to display the employee details Class name : Simple Data Members: time : stores the time duration rate : stores the rate of interest interest : stores the simple interest Member functions: Simple(. ) : parameterized constructor to assign value to data members of both the classes. void calculate( ) : calculates the simple interest as (Principal time rate) / 100 void display( ) : displays the employee details along with the rate, time and interest. Assume that the super class Account has been defined. Using the concept of inheritance, specify the class Simple giving details of constructor, void calculate( ) and void display( ). The super class and the main function need not be written. 6

Question 11 [5] A dequeue enables the user to add and remove integers from both the ends i.e. front and rear. Define a class DeQueue with the following details: Class name : DeQueue Data Members: ele[ ] : array to hold the integer elements. cap : stores the maximum capacity of the array. front : to point the index of the front. rear : to point the index of the rear. Member functions: DeQueue(int max) : constructor to initialize the data member cap = max, front = rear = 0 and create the integer array void pushfront(int v) : to add integers from the front index if possible else display the message( full from front ). int popfront( ) : to remove the return elements from front. If array is empty then return-999. void pushrear(int v) : to add integers from the front index if possible else display the message( full from rear ). int poprear( ) : to remove and return elements from rear. If the array is empty then return-999. Specify the class DeQueue giving the details of ONLY the constructor(int), pushfront(int) and int poprear ( ). Assume that the other functions have been defined. void The main( ) function need not be written. Question 12 (a) A linked list is formed from the objects of the class: [2] [4] class Node { int num; Node next; } Write an Algorithm OR a Method to insert a node at the beginning of an existing linked list. The method declaration is as follows: void InsertNode( Nodes starptr, int n ) 7

(b) Answer the following questions from the diagram of a Binary Tree given below: (i) Name the Root and the leaves of the tree. [1] (ii) Write the post order traversal of the tree. [1] (iii) Separate the Internal nodes and the External nodes of the tree. [1] PLEASE NOTE: The total weightage of questions in the Question Paper will be as indicated in the Specimen Paper. However, breakup of subparts in questions may vary from one year to another. 8