Programming and Data Structure Solved. MCQs- Part 2

Similar documents
DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.E SECOND SEMESTER CS 6202 PROGRAMMING AND DATA STRUCTURES I TWO MARKS UNIT I- 2 MARKS

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW

Data Abstractions. National Chiao Tung University Chun-Jen Tsai 05/23/2012

Code No: R Set No. 1

Department of Computer Science and Technology

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures

DEPARTMENT OF MATHS, MJ COLLEGE

DATA STRUCTURE UNIT I

FINALTERM EXAMINATION Fall 2009 CS301- Data Structures Question No: 1 ( Marks: 1 ) - Please choose one The data of the problem is of 2GB and the hard

17CS33:Data Structures Using C QUESTION BANK

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

C Multiple Choice Questions and answers MCQ with Ans.

Objective Questions for Online Practical Exams under CBCS Scheme Subject: Data Structure-I (CS-113)

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Prepared By: Ms. Nidhi Solanki (Assist. Prof.) Page 1

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 154) Pass Marks: 24

Linked List. April 2, 2007 Programming and Data Structure 1

C Programming Multiple. Choice

Reg. No. : Question Paper Code : 27157

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

PART I. Part II Answer to all the questions 1. What is meant by a token? Name the token available in C++.

Short Notes of CS201

CS201 - Introduction to Programming Glossary By

Largest Online Community of VU Students

1 P age DS & OOPS / UNIT II

1) What is the primary purpose of template functions? 2) Suppose bag is a template class, what is the syntax for declaring a bag b of integers?

CS201 Latest Solved MCQs

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

ECE 2035 Programming HW/SW Systems Fall problems, 5 pages Exam Three 28 November 2012

IECD Institute for Entrepreneurship and Career Development Bharathidasan University, Tiruchirappalli 23.

Chapter 8: Data Abstractions

PESIT Bangalore South Campus Department of MCA Course Information for

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

I BCA[ ] SEMESTER I CORE: C PROGRAMMING - 106A Multiple Choice Questions.

INSTITUTE OF AERONAUTICAL ENGINEERING

Where does the insert method place the new entry in the array? Assume array indexing starts from 0(zero).

Technical Questions. Q 1) What are the key features in C programming language?

DC104 DATA STRUCTURE JUNE Q.2 a. If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

DEEPIKA KAMBOJ UNIT 2. What is Stack?

CS8391-DATA STRUCTURES

Types of Data Structures

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

ASSIGNMENTS. Progra m Outcom e. Chapter Q. No. Outcom e (CO) I 1 If f(n) = Θ(g(n)) and g(n)= Θ(h(n)), then proof that h(n) = Θ(f(n))

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

Table of Contents. Chapter 1: Introduction to Data Structures... 1

First Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

Review of the C Programming Language for Principles of Operating Systems

Basic Data Structures (Version 7) Name:

Fundamentals of Data Structure

Q1. Multiple Choice Questions

Algorithms & Data Structures

1. Stack overflow & underflow 2. Implementation: partially filled array & linked list 3. Applications: reverse string, backtracking

Dynamic Memory Allocation and Command-line Arguments

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1

Tribhuvan University Institute of Science and Technology Computer Science and Information Technology (CSC. 154) Section A Attempt any Two questions:

Computer Systems Lecture 9

Linked Lists in C and C++

CS 8391 DATA STRUCTURES

Data Structures Through C. Student Workbook

(Section : Computer Science)

Java Notes. 10th ICSE. Saravanan Ganesh

Review of the C Programming Language

AE52/AC52/AT52 C & Data Structures JUNE 2014

Introduction to C Language (M3-R )

Sample Question Paper

CS301 - Data Structures Glossary By

DATA STRUCTURES AND ALGORITHMS

CS 241 Data Organization Binary Trees

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

ECE 2035 Programming HW/SW Systems Fall problems, 5 pages Exam Three 19 November 2014

Fundamental Data Types. CSE 130: Introduction to Programming in C Stony Brook University

University of Palestine. Final Exam 2 nd semester 2014/2015 Total Grade: 50

INTRODUCTION 1 AND REVIEW

Operators in C. Staff Incharge: S.Sasirekha

C Functions. CS 2060 Week 4. Prof. Jonathan Ventura

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

Computers Programming Course 5. Iulian Năstac

CSE 230 Intermediate Programming in C and C++

PROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)

Darshan Institute of Engineering & Technology for Diploma studies Unit 4

Answer D) ADT does not depend on the implementation

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

[ DATA STRUCTURES] to Data Structures

Programming. Data Structure

Data Structures Question Bank Multiple Choice

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

Computer Science Foundation Exam

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

UNIT- 3 Introduction to C++

a) State the need of data structure. Write the operations performed using data structures.

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Transcription:

Programming and Data Structure Solved MCQs- Part 2

Programming and Data Structure Solved MCQs- Part 2 Unsigned integers occupies Two bytes Four bytes One byte Eight byte A weather forecasting computation requires 250 billion floating point operations. The problem is processed in a supercomputer that ca perform 100 mega flops. How long will it take to do these calculations. 4167 min 40 min 52.67 min 60.12 min The value that follows the keyword CASE may only be Constants Variable Number Semicolon A data structure whose elements from a sequence is known as Non-linear Data Structure Linear Data Structure Homogeneous Data Structure Heterogeneous Data Structure

The process of production of customer list in alphabetical order falls under the category of Editing Sorting Updating Calculating If an array is used as function argument, the array is passed By value By reference By name The array cannot be used as a function argument Binary search tree is an example of Divide and conquer Greedy algorithm Back tracking Dynamic programming The earliest calculating devices are Abacus Clock Difference None of these Which of the following data structure is non-linear type? Strings Lists

Stacks None of above What value would the following function return for the input x=95 Function fun (int x) if(x>100) return fun(x-10) else return fun(fun(x+11)) 91 90 89 92 A data structure in which linear sequence is maintained by pointers is known as Pointer based data structure Stack Array Linklist The information about an array used in a program will be sorted in Symbol table Activation table System table Dope vector What does the following fragment of C-program print?

char c[] "GATE2011"; char *p =c; printf ("%s", p+p[3]-p [1] ); GATE2011 E2011 2011 011 From the point of view of the programmer, what are the major advantages of using a high-level language rather than internal machine code or assembly language? Program portability Easy development Efficiency None of the above By default real number is treated as Float Double Long double Far double Which of the following data structure is used to represent relationship between pairs, where relationship is not hierarchical? Graph Tree Hash Table Queue What is the output of the following program segment? main()

int i = ++2; printf( %d\n, i); 3 2 0-1 C allows a three-way transfer of control with the help of Unary operator Relational operator Ternary operator Comparison operator The postfix expression AB + CD * can be evaluated using a stack tree queue linked list C language was invented by Abacus Charles babage Thomson Dennis Ritchie What is the output of the following program segment? main() int i = 1; do

printf( %d.., i); while(i--); 0..1.. 1..0.. 0-1 Suppose a circular queue of capacity (n -1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are full: (REAR+1) mod n == FRONT empty: REAR == FRONT full: (REAR+1) mod n == FRONT empty: (FRONT+1) mod n == REAR full: REAR == FRONT empty: (REAR+1) mod n == FRONT full: (FRONT+1) mod n == REAR empty: REAR == FRONT Consider the following sequence of operations : (i) Pointer p1 is set to point at a new heap-dynamic variable. (ii) Pointer p2 is assigned p1 value. (iii) The heap dynamic variable pointed to by p1 is explicitly de-allocated, but p2 is not changed by the operation. This situation leads to which of the following : p1 becomes a dangling pointer p2 becomes a dangling pointer Both p1 and p2 are now dangling pointers Neither p1 nor p2 is now a dangling pointer

Consider the following program main ( ) float a = 0.5, b = 0.7; if (b < 0.8) if (a < 0.5) printf ( ABCD ); else printf ( PQR ); else printf ( JKLF); The output is ABCD PQR JKLF None of these What would be the output of the following program, if run from the command line as myprog 1 2 3? main (int argc, char * argv[ ]) int i ; i = argv[1] + argv[2] + argv[3] ; printf ( % d, i) ; 123 6 Error 123 The expression P >> 6 shifts all bits of P six places to right. What is the value of P >> 6 if P 0.6db7? 0.1234 0.0001 0.0000 0.1B6 The process of accessing data stored in a serial access memory is

similar to manipulating data on a Heap Queue Stack Binary tree Queue is a ----------- list. LIFO LILO FILO FIFO Linked lists are not suitable data structures for which one of the following problems Insertion sort Binary search Radix sort Polynomial manipulation The << operator is used for Right shifting Right shifting Bitwise shifting Bitwise complemen In a circular linked list Components are all linked together in some sequential manner There is no beginning and no end Components are arranged hierarchically

Forward and backward traversal within the list is permitted If binary tree has n leaf nodes,then number of nodes of degree 2 in T is log 2 n n-1 n 2n Consider the following C code segment. int a, b, c = 0; void prtfun(void); main( ) static int a = 1; /* Line 1 */ prtfun( ); a += 1; prtfun( ); printf( \n %d %d, a, b); void prtfun(void) static int a = 2; /* Line 2 */ int b = 1; a += ++b; printf( \n %d %d, a, b); What output will be generated by the given code segment? 3 1 4 1 4 2 4 2 6 1 6 1 4 2 6 2 2 0 3 1 5 2 5 2

Following sequence of operations is performed on a stack: PUSH (10), PUSH(20), POP,PUSH (10), PUSH (20),POP, POP, POP, PUSH (20), POP 20,10,20,10,20 20,20,20,10,20 20,10,20,10,10 20,20,10,10,20 Output of the program given below is int i; main() printf( %d, i) 1 0-1 NULL Usually, an algorithm will contain a number of procedural steps which are dependent on results of previous steps and is called. Flowchart Chart Drawing Chart Food Chart What would be output of the following program? # define SQR(X) (X*X) main() int a, b=3; a = SQR(b+2); printf( \n%d, a); 25 11 Error

Garbage value The efficient data structure to insert/delete a number in a stored set of numbers is Queue Linked list Doubly linked list Binary tree How many times the following program would print ( abc )? main() printf( \nabc ); main(); Infinite number of times 32767 times 65535 times Till the stack does not overflow When the following code is executed what will be the value of x and y? int x = 1, y = 0; y = x++; 2,1 2,2 1,1 1,2 Which of the following is a bad example of recursion? Factorial Fibonacci numbers Tower of Hanai

Tree traversal An advantage of choosing this implementation of \set of integers" is that adding an element to a set is a contact time operation. Which of the following is a disadvantage of this implementation? Adding elements to a very small sets could cause error flags to be raised. Deleting elements from very large sets could cause error ags to be raised. Deleting elements from very large sets could cause error ags to be raised. Constructing the union of two sets will require quadratic time in the size of the set being constructed. The number of different directed trees with 3 nodes are 2 3 4 5 What would be output of the following program, if the array begins at 65486? main() int arr[ ] = 12, 14, 15, 23, 45; printf( %u%u, arr+1, &arr+1); 65486, 65486 65488, 65488 65488, 65496 None of the above The name of all functions end with a Pair of parenthesis

Semicolon Braces Colon A template stores Styles, macros Auto Text entires, Customized word command Settings Graphics, text All of the above What would be output of the following program? # define SQR(X) (X*X) main() int a, b=3; a = SQR(b+2); printf( \n%d, a); 25 11 Error Garbage value The decimal value 0.5 in IEEE single precision floating point representation has fraction bits of 000 000 and exponent value of 0 fraction bits of 000 000 and exponent value of -1 fraction bits of 100 000 and exponent value of 0 no exact representation Queues serve a major role in Simulation of recursion

Simulation of arbitrary linked list Simulation of limited resources Expression evaluation Number of binary trees formed with 5 nodes are 32 64 120 42