Objective Questions of Data Structure with Answer set-6


1. .......................... is a variable that can hold the address of the variables, structure and functions that are used in the program.

A) Array

B) Pointer

C) Structure

D) None of the above



2. .................. is the organization of the data in a computers memory or in a file.

A) Array

B) Data Structure

C) Data Management

D) Data Organization



3. Which of the following is/are the advantages of using an array?

i) Multi huge quantity of data items can be stored.
ii) Arrays saves the memory space
iii) Arrays helps to arrange the data items in particular order.
iv) Data item searching is faster.

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv



4. Some examples of data structures are

i) array
ii) stack
iii) queue
iv) binary tree
v) hybrid tree

A) i, ii, iii and iv only

B) ii, iii, iv and v only

C) i, ii, iii and v only

D) All i, ii, iii, iv and v



5. Match the following components of data structure based on the concept of Abstract Data Type (ADT) with their definitions.
a) Operations                 i) Organizations of data implemented in lower level data structure.
b) Storage structures     ii) Description on how to manipulate information in the storage structure.
c) Algorithms               iii) Specifies the external appearance of data structure.

A) a-i, b-ii, c-iii

B) a-ii, b-iii, c-i

C) a-iii, b-i, c-ii

D) a-i, b-iii, c-ii



6. Match the following properties of an array with their descriptions.

a) Homogeneous     i) the list size is constant.
b) Ordered              ii) there is a first and last element.
c) Finite                  iii) there is a next and previous in the natural order of the structure
d) fixed-length        iv) every element is the same.

A) a-i, b-ii, c-iii, d-iv

B) a-ii, b-iii, c-iv, d-i

C) a-iii, b-i, c-ii, d-iii

D) a-iv, b-iii, c-ii, d-i



7. Which of the following are linear type of data structure?

i) Linked list
ii) Stack
iii) Binary Tree
iv) Array
v) Queue

A) i, ii, iii and iv only

B) ii, iii, iv and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v



8. Which of the following are non linear type of data structure?

i) Tree
ii) Graphs
iii) Hash tables
iv) List

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv




9. State whether the following statements is/are True or False.

i) An ancestor is any node in the path from the root to the node.
ii) A sub-tree is any connected structure below the root.
iii) Binary tree is a directed tree in which out degree of each node is less than or equal to one.
iv) A tree consists of finite set of elements called nodes.
v) Nodes that are not root and not leaf are called intermediate nodes.

A) True, True, True, False, True

B) True, False, True, True, False

C) True, True, True, False, False

D) True, True, False, True, False



10. In a binary search tree the node to be deleted will have two cases which are

i) An empty left sub-tree and non empty right sub-tree and vice versa.
ii) Non empty left sub-tree and right sub-tree.
iii) Empty left sub-tree and right sub-tree.

A) i and ii only

B) ii, and iii only

C) i and iii only

D) None of the above




View Answers:


1. B) Pointer

2. B) Data Structure

3. D) All i, ii, iii and iv

4. A) i, ii, iii and iv only

5. C) a-iii, b-i, c-ii

6. D) a-iv, b-iii, c-ii, d-i

7. C) i, ii, iv and v only

8. A) i, ii and iii only

9. D) True, True, False, True, False

10. A) i and ii only


Related Posts:

MCQ on Java Programming Language Fundamental set-12


1. A java program is first ................ and ...................

A) executed, run

B) compiled, run

C) run, compiled

D) interpreted, compiled


2. Byte code is also a ...........

A) machine code

B) bit code

C) cryptographic code

D) none


3. A private class is accessible from inside a .................

A) package

B) class

C) method

D) none


4. Consider the statement "x=(a>b)?a:b", then the value of x is 19, if a=19 and b=12

A) true

B) not supported

C) false

D) none of the above


5. Adapter classes are used for ...............

A) code redundancy

B) code reduction

C) code organization

D) none


6. ..................... inheritance is enable by interface in java.

A) min level

B) multiple

C) low level

D) none


7. .................... is generated if a button is clicked in AWT.

A) ItemEvent

B) WindowEvent

C) ActionEvent

D) MouseEvent


8. Using which keyword we can access value of the instance and class variables of that class inside the method of that class itself.

A) super

B) final

C) this

D) either super or this


9. If a variable is declared FINAL, it must include ......................... value.

A) integer

B) number

C) initial

D) float


10. In java, string is a

A) primitive data type

B) abstract data type

C) combination of boolean

D) None of the above


11. Methods can be overloaded with a difference only in the type of the return value

A) Not supported

B) False

C) True

D) None of the above


12. Each method in a java class must have a unique name

A) Not necessarily

B) True

C) False

D) None of the above


13. It is an important feature of java that it always provides a default constructor to a class

A) Not supported

B) False

C) True

D) None of the above


14. If one or more abstract methods are not implemented in an abstract class, then the subclass is also abstract.

A) Not necessarily

B) False

C) True

D) None of the above


15. Life cycle of an applet is described by .................. methods.

A) six

B) three

C) four

D) five


16. Which of the following is not subclass of "writer" stream.

A) FileWriter

B) LineWriter

C) BufferedWriter

D) PrintWriter


17. In java RMI, stub is located in

A) client machine

B) proxy

C) server

D) none of the above


18. The new keyword will

i) create in instance of an object

ii) create instance of a class

iii) assign memory to an array

iv) call the destructor of a class

A) i and iii

B) ii and iii

C) i and ii

D) ii, iii and iv


19. ODBC stands for

A) Object Data Binding Command

B) Open Database Console

C) Open Database Connectivity

D) Open Database Command


20. Continue statement can be used

i) anywhere inside main method

ii) anywhere inside class

iii) within instance methods

iv) only within looping statements

A) i, ii and iii

B) i and iv

C) only iv

D) ii, iii and iv





Show/Hide Answers:




1. A java program is first ................ and ...................

B) compiled, run

2. Byte code is also a ...........

D) none

3. A private class is accessible from inside a .................

B) class

4. Consider the statement "x=(a>b)?a:b", then the value of x is 19, if a=19 and b=12

A) true

5. Adapter classes are used for ...............

B) code reduction

6. ..................... inheritance is enable by interface in java.

B) multiple

7. .................... is generated if a button is clicked in AWT.

C) ActionEvent

8. Using which keyword we can access value of the instance and class variables of that class inside the method of that class itself.

C) this

9. If a variable is declared FINAL, it must include ......................... value.

C) initial

10. In java, string is a

B) abstract data type

11. Methods can be overloaded with a difference only in the type of the return value

B) False

12. Each method in a java class must have a unique name

A) Not necessarily

13. It is an important feature of java that it always provides a default constructor to a class

C) True

14. If one or more abstract methods are not implemented in an abstract class, then the subclass is also abstract.

C) True

15. Life cycle of an applet is described by .................. methods.

C) four

16. Which of the following is not subclass of "writer" stream.

B) LineWriter

17. In java RMI, stub is located in

A) client machine

18. The new keyword will

i) create in instance of an object

ii) create instance of a class

iii) assign memory to an array

iv) call the destructor of a class

A) i and iii

B) ii and iii

C) i and ii

D) ii, iii and iv

19. ODBC stands for

A) Object Data Binding Command

B) Open Database Console

C) Open Database Connectivity

D) Open Database Command

20. Continue statement can be used

i) anywhere inside main method

ii) anywhere inside class

iii) within instance methods

iv) only within looping statements

C) only iv



Related Posts:


MCQ on Basic SQL Queries with Answers set-1


1. DML is provided for

A) Description of logical structure of database

B) Addition of new structure in the database system.

C) Manipulation & processing of database

D) Definition of physical structure of database system


2.'AS' clause is used in SQL for

A) Selection operation

B) Rename Operation

C) Join operation

D) Projection Operation


3. Count function in SQL returns the number of

A) values

B) distinct values

C) groups

D) columns


4. The statement in SQL which allows to change the definition of a table is

A) Alter

B) Update

C) Cteate

D) Select


5. Which of the following is correct.

A) A SQL query automatically eliminates duplicates

B) SQL permits attribute names to be repeated in the same relation

C) A SQL query will not work if there are no indexes on the relations

D) None of the above


6. Which of the following operation is used if we are interested in only certain columns of a table?

A) PROJECTION

B) SELECTION

C) UNION

D) JOIN


7. Which of the following is a legal expression in SQL?

A) SELECT NULL FROM EMPLOYEE;

B) SELECT NAME FROM EMPLOYEE;

C) SELECT NAME FROM EMPLOYEE WHERE SALARY=NULL;

D) None of the above


8. Which of the following is a valid SQL type?

A) CHARACTER

B) NUMERIC

C) FLOAT

D) All of the above


9. Which command is used to select distinct subject (SUB) from the table (BOOK)?

A) SELECT ALL FROM BOOK

B) SELECT DISTINCT SUB FROM BOOK

C) SELECT SUB FROM BOOK

D) All of the above


10. In SQL, which of the following is not a data definition language commands?

A) RENAME

B) REVOKE

C) GRANT

D) UPDATE





Answers:


1. DML is provided for

C) Manipulation & processing of database

2.'AS' clause is used in SQL for

B) Rename Operation

3. Count function in SQL returns the number of

A) values

4. The statement in SQL which allows to change the definition of a table is

A) Alter

5. Which of the following is correct.

D) None of the above

6. Which of the following operation is used if we are interested in only certain columns of a table?

A) PROJECTION

7. Which of the following is a legal expression in SQL?

B) SELECT NAME FROM EMPLOYEE;

8. Which of the following is a valid SQL type?

D) All of the above

9. Which command is used to select distinct subject (SUB) from the table (BOOK)?

B) SELECT DISTINCT SUB FROM BOOK

10. In SQL, which of the following is not a data definition language commands?

D) UPDATE 




Related Posts:




Solved MCQ on Database Normalization set-1



1. A ..................... specifies the actions needed to remove the drawbacks in the current design of database.

A) 1 NF

B) 2 NF

C) 3 NF

D) Normal form



2. A relation is in ........................... if an attribute of a composite key is dependent on an attribute of other composite key.

A) 2NF

B) 3NF

C) BCNF

D) 1NF



3. Fifth Normal form is concerned with

A) Functional dependency

B) Multivalued dependency

C) Join dependency

D) Domain key



4. A table is in the ....................... if only candidate keys are the determinants.

A) functional dependency

B) transitive dependency

C) 4 NF

D) BCNF



5. In 2NF

A) No functional dependencies exist.

B) No multivalued dependencies exist.

C) No partial functional dependencies exist

D) No partial multivalued dependencies exist.


6. The normal form that is not necessarily dependency preserving is

A) 2NF

B) 3NF

C) BCNF

D) 4NF



7. The ................. is related to the concept of multi-valued dependency.

A) fourth normal form

B) fifth normal form

C) boyce codd normal form

D) third normal form



8. Which normal form is considered adequate for normal relational database design?

A) 2NF

B) 5NF

C) 4NF

D) 3NF



9. Dependency preservation is not guaranteed in

A) BCNF

B) 3NF

C) 4NF

D) DKNF



10. A relation is ................... if every field contains only atomic values that is, no lists or sets.

A) 1 NF

B) 2 NF

C) 3 NF

D) BCNF



Answers:



1. A ..................... specifies the actions needed to remove the drawbacks in the current design of database.

D) Normal form

2. A relation is in ........................... if an attribute of a composite key is dependent on an attribute of other composite key.

B) 3NF

3. Fifth Normal form is concerned with

C) Join dependency

4. A table is in the ....................... if only candidate keys are the determinants.

D) BCNF

5. In 2NF

C) No partial functional dependencies exist

6. The normal form that is not necessarily dependency preserving is

A) 2NF

7. The ................. is related to the concept of multi-valued dependency.

A) fourth normal form

8. Which normal form is considered adequate for normal relational database design?

D) 3NF

9. Dependency preservation is not guaranteed in

A) BCNF

10. A relation is ................... if every field contains only atomic values that is, no lists or sets.

A) 1 NF





 Related Posts:



MCQ on c++ Programming with Answers set-6


1. If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access.

A) Protected and public data only in C and B

B) Protected and public data only in C

C) Private data in A and B

D) Protected data in A and B


2. Overloading the function operator

A) requires a class with an overloaded operator

B) requires a class with an overloaded [ ] operator.

C) allows you to create objects that act syntactically like functions.

D) usually make use of a constructor that takes arguments.


3. What is a constructor?

A) A function called when an instance of a class is initialized.

B) A function that is called when an instance of a class is deleted.

C) A special function to change the value of dynamically allocated memory

D) A function that is called in order to change the value of a variable.


4. Mechanism of deriving a class from another derived class is known as .........

A) Polymorphism

B) Single Inheritance

C) Multilevel Inheritance

D) Message Passing


5. RunTime Polymorphism is achieved by ..........

A) friend function

B) virtual function

C) operator overloading

D) function overloading


6. Which of the following is the proper declaration of a pointer?

A) int x;

B) int &x;

C) ptr x;

D) int *x;


7. In multiple inheritance

A) the base classes must have only default constructors

B) cannot have virtual functions

C) can include virtual classes

D) None of the above


8. for (; ;)

A) means the test which is done using some expression is always true

B) is not valid

C) will loop forever

D) should be written as for( )


9. The compilers converts all operands upto to type of the largest operand is called as ............

A) typeconversion

B) expression

C) evaluation

D) precedence


10. The keyword FRIEND does not appear in

A) the class allowing access to another class

B) the class desiring access to another class

C) the private section of a class

D) the public section of a class





Answers:


1. If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access.

D) Protected data in A and B

2. Overloading the function operator

A) requires a class with an overloaded operator

3. What is a constructor?

A) A function called when an instance of a class is initialized.

4. Mechanism of deriving a class from another derived class is known as .........

C) Multilevel Inheritance

5. RunTime Polymorphism is achieved by ..........

B) virtual function

6. Which of the following is the proper declaration of a pointer?

D) int *x;

7. In multiple inheritance

C) can include virtual classes

8. for (; ;)

C) will loop forever

9. The compilers converts all operands upto to type of the largest operand is called as ............

A) typeconversion

10. The keyword FRIEND does not appear in

C) the private section of a class



Related Posts:


MCQ on C Programming With Answers set-4


1. 'C' is often called a ....

A) Object oriented language

B) High level language

C) Assembly language

D) Machine level language


2. Each C preprocessor directive begins with ....

A) #

B) include

C) main()

D) {


3. C allows arrays of greater than two dimensions, who will determine this?

A) programmer

B) compiler

C) parameter

D) None of the above


4. The << operator is used for

A) Right shifting

B) Left shifting

C) Bitwise shifting

D) Bitwise complement


5. Set of values of the same type, which have a single name followed by an index is called

A) function

B) structure

C) array

D) union


6. Which of the following header file is required for strcpy() function?

A) String.h

B) Strings.h

C) file.h

D) strcpy()


7. scanf() can be used for reading ...

A) double character

B) single character

C) multiple characters

D) no character


8. A variable which is visible only in the function in which it is defined is called

A) Static variable

B) auto variable

C) external variable

D) local variable


9. In the loop structure logical expression is checked at the ....................of the loop.

A) first

B) end

C) middle

D) second


10. If an array is used as function argument, the array is passed

A) by value

B) by reference

C) by name

D) the array cannot be used as function argument


11. If is necessary to declare the type of function in the calling program if

A) Function returns an integer

B) Function returns a non-integer value

C) Function is not defined in the same file

D) Function is called number of times


12. Which escape character can be used to begin a new line in C ........

A) \a

B) \m

C) \b

D) \n


13. Input/output function prototypes and macros are defined in which header file?

A) conio.h

B) stdlib.h

C) stdio.h

D) dos.h


14. What is the purpose of fflush() function?

A) flushes all streams and specified streams

B) flushes only specified stream

C) flushes input/output buffer

D) flushes file buffer


15. What does the following declaration mean?int(*ptr)[10].

A) ptr is array of pointers to 10 integers.

B) ptr is a pointer to an array of 10 integers

C) ptr is an array of 10 integers

D) ptr is an pointer to array





Answers:



1. 'C' is often called a ....

B) High level language

2. Each C preprocessor directive begins with ....

A) #

3. C allows arrays of greater than two dimensions, who will determine this?

B) compiler

4. The << operator is used for

B) Left shifting

5. Set of values of the same type, which have a single name followed by an index is called

C) array

6. Which of the following header file is required for strcpy() function?

A) String.h

7. scanf() can be used for reading ...

C) multiple characters

8. A variable which is visible only in the function in which it is defined is called

D) local variable

9. In the loop structure logical expression is checked at the ....................of the loop.

A) first

10. If an array is used as function argument, the array is passed

B) by reference

11. If is necessary to declare the type of function in the calling program if

B) Function returns a non-integer value

12. Which escape character can be used to begin a new line in C ........

D) \n

13. Input/output function prototypes and macros are defined in which header file?

C) stdio.h

14. What is the purpose of fflush() function?

A) flushes all streams and specified streams

15. What does the following declaration mean?int(*ptr)[10].

B) ptr is a pointer to an array of 10 integers




Related Posts