DS MCQs

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 25

Which of the following data structure is used to represent relationship between

pairs, where relationship is not hierarchical ?


A. Graph
B. Tree
C. Hash Table
D. Queue
Answer A

Which of the following data structure is used to represent hierarchical


relationship among its elements?
A. Graph
B. Tree
C. Hash Table
D. Queue
Answer B

If a binary tree satisfies shape and order property its known as


A. Binary Search Tree
B. Sequential Search Tree
C. Heap
D. Rooted Tree
Answer C

A data structure in which linear sequence is maintained by pointers is known as


A. Pointer based data structure
B. Stack
C. Array
D. Linklist
Answer D
A data structure whose elements from a sequence is known as
A. Non-linear Data Structure
B. Linear Data Structure
C. Homogeneous Data Structure
D. Heterogeneous Data Structure
Answer B
Each attribute of an entity has a defined set of values. This set of values is
called a
A. Range
B. Domain
C. Entity Set
D. Mapping
Answer B

A data item that cannot be divided into sub items is known as


A. Primary Data Item
B. Primary Key
C. Group Data Item
D. Elementary Data Item
Answer C

Inheritance is a feature of --------------language


A. C Language
B. C++ Language
C. Basic
D. Cobol
Answer B

The statement that transfers control to the beginning of the loop is called
A. Break statement
B. Exit statement
C. Continue statement
D. Goto statement
Answer C

The language that the computer can understand and execute is called
A. Machine Language
B. Application Software
C. System Program
D. Assembly language

Answer A
The keyword used to transfer control from a function back to the calling function
is
A. Switch
B. Goto
C. Go back
D. Return
Answer D

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 a function argument
Answer B

In C, if you pass an array as an argument to a function, what actually gets passed?

A. Value of elements in array


B. First element of the array
C. Base address of the array
D. Address of the last element of array
Answer C

The break statement causes an exit


A. Only from the innermost loop
B. Only from the innermost switch
C. From the innermost loop or switch
D. From the program
Answer C

The smallest element of an arrays index is called its


A. Lower bound
B. Upper bound
C. Range
D. Extraction
Answer A
If a = 5 and b = 7 then the statement p = (a > b) : a ? b
A. assigns a value 5 to p
B. assigns a value 7 to p
C. assigns a value 8 to p
D. gives an error message
Answer D

The __________ statement causes immediate exit from the loop overriding the
condition test
A. Exit
B. Break
C. Goto
D. None of the above
Answer B

The value that follows the keyword CASE may only be


A. Constants
B. Variable
C. Number
D. Semicolon
Answer A

The machine registers are sometimes called


A. Local variables
B. Global variables
C. Accumulators
D. Static variables
Answer A

The C language includes the header file standard input & output in
A. stdlib.h library
B. stdio.h library
C. conio.h library
D. #include library
Answer B
Consider the following recursive C function that takes two arguments.
unsigned int foo(unsigned int n,unsigned int r)
{ if(n>0)
return((n%r)+foo(n/r,r));
else
return 0;
}
What is value of function foo when it called as foo(512,2)?
A. 9
B. 2
C. 8
D. 11
Answer B

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);
}
A. 25
B. 11
C. Error
D. Garbage value
Answer B

Number of possible binary trees with 3 nodes is


A. 12
B. 13
C. 14
D. 15
Answer D
The expression X=4+2%-8 evaluate
A. -6
B. 6
C. 4
D. None
Answer B

The data structure needed to convert a recursion to an iterative procedure is


A. Queue
B. Graph
C. Stack
D. Tree
Answer C
What punctuation is used to signal the beginning and end of code blocks?
A. { }
B. -> and <-
C. BEGIN and END
D. ( and )
Answer A

What is the output of the following program segment?


main()
{
int i = ++2;
printf(%d\n, i);
}
A. 3
B. 2
C. 0
D. -1
Answer A

An algorithm that calls itself directly or indirectly is known as


A. Sub algorithm
B. Recursion
C. Polish notation
D. Traversal algorithm
Answer B

A Compiler is _____________________.
A. A combination of computer hardware
B. A program which translates from one high-level language to another
C. A program which translates from one high-level to a machine level
D. None of these
Answer C

A binary tree in which if all its levels except possibly the last, have the maximum
number of nodes and all the nodes at the last level appear as far left as possible,
is known as
A. Full binary tree
B. AVL tree
C. Threaded tree
D. Complete binary tree
Answer A
Which allows deletion at only one end of the list but allows insertion at both ends
of the list?
A. Deque
B. Circular queue
C. Output restricted deque
D. Input restricted deque
Answer C

A technique for direct search is


A. Binary Search
B. Linear Search
C. Tree Search
D. Hashing
Answer D

The maximum value that an integer constant can have is


A. .32767
B. 32767
C. 1.7014e+38
D. 1.7014e+38
Answer B

What would be output of the following program?


#include "stdio.h"
main()
{
printf(%d%d, size of (NULL!), size of ( ));
}
A. 2 1
B. 1 2
C. 2 2
D. 1 1
Answer C

It 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

Answer BC language was invented by


A. Abacus
B. Charles babage
C. Thomson
D. Dennis Ritchie
Answer D

The _______ operator is a technique to forcefully convert one data type to the
others
A. Cast
B. Conversion
C. Type
D. Unary
Answer A

A binary tree whose every node has either zero or two children is called
A. Complete binary tree
B. Binary search tree
C. Extended binary tree
D. None of above
Answer C

A mathematical-model with a collection of operations defined on that model is


called
A. Data Structure
B. Abstract Data Type
C. Primitive Data Type
D. Algorithm
Answer B
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);
}
A. 65486, 65486
B. 65488, 65488
C. 65488, 65496
D. None of the above
Answer C

Which data structure allows deleting data elements from front and inserting at
rear?
A. Stacks
B. Queues
C. Deques
D. Binary search tree

Answer B

A binary tree in which if all its levels except possibly the last, have the maximum
number of nodes and all the nodes at the last level appear as far left as possible,
is known as
A. Full binary tree
B. AVL tree
C. Threaded tree
D. Complete binary tree

Answer A

What is the correct value to return to the operating system upon the successful
completion of a program?
A. -1
B. 1
C. 0
D. Programs do not return a value.

Answer C

Queues serve a major role in


A. Simulation of recursion
B. Simulation of arbitrary linked list
C. Simulation of limited resources
D. Expression evaluation
Answer C
Select the true statement.
A. Every binary tree is either complete or full
B. Every complete binary tree is also a full binary tree
C. Every full binary tree is also a complete binary tree
D. No binary tree is both complete and full
Answer B

The control automatically passes to the first statement after the loop in
A. Continue statement
B. Break statement
C. Switch statement
D. If statement

Answer B

What will be the output of following program?


main()
{
int x=15;
printf(\n%d%d%d, x!=15, x=20, x<30);
}
A. 0, 20, 1
B. 15, 20, 30
C. 0, 0, 0
D. Error

Answer A

Which of the following was not associated with second generation computers?
A. High level procedural language
B. Operating system
C. Magnetic core and transistor
D. All of the above were associated
Answer D

A linear list of elements in which deletion can be done from one end (front) and
insertion can take place only at the other end (rear) is known as a
A. Queue
B. Stack
C. Tree
D. Linked list
Answer A
An array of pointers is same as
A. Pointer to array
B. Pointers to pointers
C. Pointer to function
D. Pointer to structure
Answer B

A linear list of elements in which deletion can be done from one end (front) and
insertion can take place only at the other end (rear) is known as a
A. Queue
B. Stack
C. Tree
D. Linked list
Answer A

Let the following circular queue can accommodate maximum six elements with the
following data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?
A. front = 2 rear = 5
queue = ______; L, M, N, O, ___
B. front = 3 rear = 5
queue = L, M, N, O, ___
C. front = 3 rear = 4
queue = ______; L, M, N, O, ___
D. front = 2 rear = 4
queue = L, M, N, O, ___
Answer A

What data structure would you mostly likely see in a nonrecursive implementation of
a recursive algorithm?
A. Stack
B. Linked list
C. Queue
D. Trees
Answer A

The data structure required to check whether an expression contains balanced


parenthesis is
A. Stack
B. Queue
C. Tree
D. Array

Answer A
What will be the output of the following program?
main()
{
int i = 5;
printf(%d, i=++i==6);
}
A. 0
B. 1
C. 7
D. 6
Answer B

The << operator is used for


A. Right shifting
B. Right shifting
C. Bitwise shifting
D. Bitwise complemen
Answer B

The function fprintf is used in a program


A. When too many printf calls have been already used in the program
B. In place of printf, since printf uses more memory
C. When the output is to be printed on to a file
D. When the type of variables to be printed are not known before

Answer C

Which of the following is not a correct variable type?


A. float
B. real
C. int
D. double
Answer B

Which number system is usually followed in a typical 32-bit computer?


A. 2
B. 10
C. 16
D. 32

Answer A
Which of the following data structure is non-linear type?
A. Strings
B. Lists
C. Stacks
D. None of above

Answer D

Which technology is used in optical disks?


A. Mechanical
B. Electrical
C. Electro Magnetic
D. Laser
Answer D

Binary search tree is an example of


A. Divide and conquer
B. Greedy algorithm
C. Back tracking
D. Dynamic programming
Answer D

Output of the following program fragment is


x = 5;
y = x++;
printf(%d%d, x, y);
A. 5, 6
B. 5, 5
C. 6, 5
D. 6, 6
Answer C

B Trees are generally


A. Very deep and narrow
B. Very wide and shallow
C. Very deep and very wide
D. Cannot say
Answer D
What will happen if the following loop is executed?
int num = 0;
do
{
--num;
printf(%d, num);
num++;
}while (num >= 0);
}
A. The loop will run infinite number of times.
B. The program will not enter the loop.
C. There will be a compilation error.
D. There will be runtime error.

Answer C

A node in a linked list must contain at least


A. Three fields
B. Two fields
C. Four fields
D. One field

Answer B

Which of the following storage devices can store maximum amount of data?
A. Floppy Disk
B. Hard Disk
C. Compact Disk
D. Magneto Optic Disk

Answer B

Consider the following recursive C function that takes two arguments. unsigned int
foo(unsigned int n,unsigned int r) { if(n>0)return((n%r)+foo(n/r,r)); else return
0; } What is value of function foo when it called as foo(342,10)?
A. 11
B. 12
C. 3
D. 6
Answer B

_______is called self referential structure.


A. Linked list
B. Stack
C. Queue
D. Graph
Answer A
The earliest calculating devices are
A. Abacus
B. Clock
C. Difference
D. None of these
Answer A

The information about an array used in a program will be sorted in


A. Symbol table
B. Activation table
C. System table
D. Dope vector
Answer D

Representation of data structure in memory is known as


A. Recursive
B. Abstract data type
C. Storage structure
D. File structure
Answer B

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
A. ABCD
B. PQR
C. JKLF
D. None of these
Answer B

Linked lists are not suitable for implementing


A. Insertion sort
B. Binary search
C. Radix sort
D. Polynomial manipulation
Answer B
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
Answer D

The number of different directed trees with 3 nodes are


A. 2
B. 3
C. 4
D. 5
Answer B

The process of accessing data stored in a serial access memory is similar to


manipulating data on a
A. Heap
B. Queue
C. Stack
D. Binary tree
Answer C

Quick sort is also known as


A. Merge sort
B. Heap sort
C. Bubble sort
D. None of these
Answer D

A linear collection of data elements where the linear node is given by means of
pointer is called
A. Linked list
B. Node list
C. Primitive list
D. None of these
Answer A

The searching technique that takes O(1) time to find a data is


A. Linear Search
B. Binary Search
C. Hashing
D. Tree Search
Answer C

Heap allocation is required for languages


A. That support recursion
B. That support dynamic data structure
C. That use dynamic scope rules
D. None of these
Answer B

Which of the following is FALSE in C


A. Keywords can be used as variable names
B. Variable names can contain a digit
C. Variable names do not contain a blank space
D. Capital letters can be used in variable names
Answer A

If a node having two children is deleted from a binary tree, it is replaced by its
A. Inorder predecessor
B. Inorder successor
C. Preorder predecessor
D. None of the above

Answer B

The process of production of customer list in alphabetical order falls under the
category of
A. Editing
B. Sorting
C. Updating
D. Calculating
Answer B

The statement which is used to terminate the control from the loop is
A. Break
B. Continue
C. Goto
D. Exit
Answer A

The expression P >> 6 shifts all bits of P six places to right. What is the value
of P >> 6 if P 0.6db7 ?
A. 0.1234
B. 0.0001
C. 0.0000
D. 0.1B6
Answer D

Output of the program given below is


int i;
main()
{
printf(%d, i)
A. 1
B. 0
C. -1
D. NULL
Answer B

An ADT is defined to be a mathematical model of a user-defined type along with the


collection of all ____________ operations on that model.
A. Cardinality
B. Assignment
C. Primitive
D. Structured

Answer C

Literal means
A. A string
B. A string constant
C. A character
D. An alphabet
Answer B

The value of an automatic variable that is declared but not initialised will be
A. 0
B. -1
C. Unpredictable
D. None of these
Answer C

A language in which a statement in a loop that run 100 times and is decoded 100
times is
A. BASIC
B. FORTAN
C. COBAL
D. PASCAL
Answer A

Which of the following cannot be checked in a switch case statement?


A. Character
B. Integer
C. Float
D. Enum

Answer C

A linear collection of data elements where the linear node is given by means of
pointer is called
A. Linked list
B. Node list
C. Primitive list
D. None of these
Answer A

Each C preprocessor directive begins with


A. #
B. include
C. main
D. {
Answer A

The name of all functions end with a


A. Pair of parenthesis
B. Semicolon
C. Braces
D. Colon
Answer A

A sort which relatively passes through a list to exchange the first element with
any element less than it and then repeats with a new first element is called
A. Insertion sort
B. Selection sort
C. Heap sort
D. Quick sort
Answer D

The process of accessing data stored in a tape is similar to manipulating data on a

A. Stack
B. Queue
C. List
D. Heap
Answer B

You have to sort a list L consisting of a sorted list followed by a few random
elements.Which of the following sorting methods would be especially suitable for
such a task?
A. Bubble sort
B. Selection sort
C. Quick sort
D. Insertion sort
Answer D

How many times the following program would print (abc)?


main()
{
printf(\nabc);
main();
}
A. Infinite number of times
B. 32767 times
C. 65535 times
D. Till the stack does not overflow
Answer A

The statement which is used to terminate the control from the loop is
A. Break
B. Continue
C. Goto
D. Exit
Answer A

The data structure required to evaluate a postfix expression is


A. Queue
B. Stack
C. Array
D. Linked-list
Answer B

The following program fragment


int *a;
*a = 7;
A. assigns 7 to a
B. results in compilation error
C. assigns address of a as 7
D. segmentation fault
Answer D

________ unit controls the flow and manipulation of data and information.
A. Arithmetic logic
B. Central
C. Middle
D. Control
Answer D

Output of following Program


main() {
long i = 30000;
printf(%d, i); }
the output is
A. 3000
B. 3000
C. -1
D. 0

Answer B

Applications of Linked List are


A. Simulation , event driven systems
B. Postfix and prefix manipulations
C. Dictionary systems, polynomial manipulations
D. Fixed block storage allocation, garbage collection
Answer D

C is often called
A. Object oriented language
B. High level language
C. Assembly language
D. Machine level language
Answer B

Usually, an algorithm will contain a number of procedural steps which are dependent
on results of previous steps and is called _______________.
A. Flowchart
B. Chart
C. Drawing Chart
D. Food Chart
Answer A

Linked lists are not suitable data structures for which one of the following
problems
A. Insertion sort
B. Binary search
C. Radix sort
D. Polynomial manipulation
Answer B

Determine which of the following is a valid character constant


A. \\
B. \0
C. xyz
D. \052
Answer A

A template stores
A. Styles, macros
B. Auto Text entires, Customized word command Settings
C. Graphics, text
D. All of the above
Answer A

A complete binary tree with the property that the value at each node is atleast as
large as the values at its children is called
A. Binary search tree
B. AVL tree
C. Completely balanced tree
D. Heap
Answer D

Unsigned integer occupies


A. Two bytes
B. Four bytes
C. One byte
D. Eight bytes
Answer B

In addition to communicating with I/O, the processor must communicate with the
______________ unit.
A. Control
B. Memory
C. Arithmetic
D. Process
Answer B

Which one of the following is a physical data structure?


A. Array
B. Linked list
C. Stack
D. Table
Answer A

A BST is traversed in the following order recursively: Right, root, left.The output
sequence will be in
A. Ascending order
B. Descending order
C. Bitomic sequence
D. No specific order
Answer B

A self contained block of statements that perform a coherent task of some kind is
called a
A. Monitor
B. Function
C. Program
D. Structure
Answer B

The directive that can be used to test whether an expression evaluates to a nonzero
value or not is
A. #if
B. #elif
C. #endif
D. #exit
Answer A

What will happen if in a C program you assign a value to an array element whose
subscript exceeds the size of array?
A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.
Answer C

The data structure required for Breadth First Traversal on a graph is


A. Queue
B. Stack
C. Array
D. Tree

Answer A

Which amongst the following is not a keyword?


A. External
B. Int
C. Float
D. Double
Answer A

Is the following statement a declaration or definition? extern int i;


A. Declaration
B. Definition
C. Function
D. Error
Answer A

What is the output of the following program segment?


main()
{
int i = 1;
do
{
printf(%d.., i);
}
while(i--);
}
A. 0..1..
B. 1..0..
C. 0
D. -1
Answer B

If a node in a BST has two children, then its inorder predecessor has
A. No left child
B. No right child
C. Two children
D. No child
Answer B

What is the only function all C++ programs must contain?


A. start()
B. system()
C. main()
D. program()
Answer C

What data structure would you mostly likely see in a non recursive implementation
of a recursive algorithm?
A. Stack
B. Linked list
C. Queue
D. Trees
Answer A

The number of nodes in a complete binary tree of level 5 is


A. 15
B. 25
C. 63
D. 71
Answer C

If an integer occupies 4 bytes and a character occupies 1 bytes of memory, each


element of the
following structure would occupy how many bytes?
struct name
{
int age;
char name [20];
}
A. 5
B. 24
C. 21
D. 22
Answer B

What is the output of the following program segment?


main()
{
long i = 65536;
printf(%d\n, i);
}
A. 0
B. 65536
C. -1
D. 65
Answer A

In a circular linked list


A. Components are all linked together in some sequential manner
B. There is no beginning and no end
C. Components are arranged hierarchically
D. Forward and backward traversal within the list is permitted
Answer B

Identify the data structure which allows deletions at both ends of the list but
insertion at only one end.
A. Input-restricted deque
B. Output-restricted deque
C. Priority queues
D. None of above
Answer A

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
Answer C

Output of the following program fragment is


printf (%d, printf (tim));
A. results in a syntax error
B. outputs tim3
C. outputs garbage
D. outputs tim and terminates abruptly
Answer B

A pointer variable can be


A. Passed to a function as argument
B. Changed within function
C. Returned by a function
D. Assigned an integer value
Answer C

The data structure required for Breadth First Traversal on a graph is


A. Queue
B. Stack
C. Array
D. Tree
Answer A

Which one of the following permutations can be obtained the output using stack
assuming that the input is the sequence 1,2,3,4,5 in that order ?
A. 3,4,5,1,2
B. 3,4,5,2,1
C. 1,5,2,3,4
D. 5,4,3,1,2
Answer: B

The initial configuration of the queue is a,b,c,d (a is the front end). To get the
configuration d,c,b,a one needs a minimum of ?
A. 2 deletions and 3 additions
B. 3 additions and 2 deletions
C. 3 deletions and 3 additions
D. 3 deletions and 4 additions
Answer: C

Linked list are not suitable data structure of which one of the following
problems ?
A. Insertion sort
B. Binary search
C. Radix sort
D. Polynomial manipulation
Answer: B

The number of possible ordered trees with three nodes A,B,C is?
A. 16
B. 12
C. 6
D. 10
Answer: B.

Which of the following algorithm design technique is used in the quick sort
algorithm?
A. Dynamic programming
B. Backtracking
C. Divide and conquer
D. Greedy method
Answer: C

The number of swapping needed to sort numbers 8,22,7,9,31,19,5,13 in ascending


order using bubble sort is ?
A. 11
B. 12
C. 13
D. 14
Answer: D

Which of the following statement is true ?


A. Optimal binary search tree construction can be performed efficiently using
dynamic programming.
B. Breath first search cannot be used to find converted components of a graph.
C. Given the prefix and post fix walks over a binary tree.The binary tree cannot be
uniquely constructe
D. Depth first search can be used to find connected components of a graph.
Answer: A

Given two sorted lists of size m and n respectively.The number of comparisons


needed in the worst case by the merge sort algorithm will be?
A. mn
B. max(m,n)
C. min(m,n)
D. m+n-1
Answer: D

Merge sort uses ?


A. Divide and conquer strategy
B. Backtracking approach
C. Heuristic search
D. Greedy approach
Answer: A

Which of the following algorithm design technique is used in the quick sort
algorithm?
A. Dynamic programming
B. Backtracking
C. Divide and conquer
D. Greedy method
Answer: C

Which of the following is useful in traversing a given graph by breadth first


search?
A. Stack
B. Set
C. List
D. Queue
Answer: D

Which of the following is useful in implementing quick sort?


A. Stack
B. Set
C. List
D. Queue
Answer: A
An IP address is a numeric quantity that identifies -
A. a network adapter to other devices on the network
B. the manufacturer of a computer
C. the physical location of a computer
D. none of the above
Answer: A

You can make telephone calls over the Internet using a technology called
A. Intertel
B. Telenet
C. VoIP
D. VoRP
Answer: c

What is the result of the following operation Top (Push (S, X))
A. X
B. null
C. s
D. none of these
Answer: A

Queue can be used to implement ?


A. quick sort
B. merge sort
C. heap sort
D. insertion sort
Answer: A

The number of binary trees with 3 nodes which when traversed in post order gives
the sequence A,B,C is ?
A. 3
B. 9
C. 7
D. 5
Answer: D

Sparse matrices have ?


A. no zero
B. many zero
C. higher dimenstion
D. none
Answer: B

The postfix expression for * + a b - c d is?


A. ab + cd - *
B. ab cd + - *
C. ab + cd * -
D. ab + - cd *
Answer: A

A vertex of degree one is called


A. padent
B. isolated vertex
C. null vertex
D. colored vertex
Answer: A

The average search time of hashing with linear probing will be less if the load
factor?
a. is far less than one
b. equals one
c. is far greater than one
d.None of the above
Answer: a

The complexity of binary search algorithm is ?


a. n
b. n logn
c. logn
d. n2
answer: d

the postfix equivalent of the prefix *+ab-cd is?


a. ab+cd-*
b. abcd+-*
c. ab+cd*-
d. ab+-cd*
answer: a

the linked list implementation of sparse matrices is superior to the generalized


dope vector method because it is?
a. Conceptually easier
b. Complete dynamic
c. Efficient in accessing an entry
d. Efficient if the sparse matrix is a band matrix
e. A and B
Answer: e

Sparse matrix has?


a. Many zero entries
b. Many non zero entries
c. Higher dimension
d. None of the above
Answer: a

Which of the following algorithm solves the all pair shortest path problem?
a. Djikstras algorithm
b. Floyds algorithm
c. Prims algorithm
d. Warshalls algorithm
Answer: b

As part of maintenance work, you are entrusted with the work of rearranging the
library books in a shelf in proper order, at the end of each day. The ideal choice
will be?
a. Bubble sort
b. Insertion sort
c. Selection sort
d. Heap sort
Answer: b

The way a card game player arrange his cards as he picks them up one by one, is an
example?
a. Bubble sort
b. Selection sort
c. Insertion sort
d. Merge sort
Answer: c

The average successful search time for sequential search on n items is?
a. n/2
b. (n-1)/2
c. (n+2)/2
d. Log(n)+1
Answer: c

Linked lists are suitable for which of the following problems?


a. Insertion sort
b. Binary search
c. Radix sort
d. Polynomial manipulation
Answer: b

If the sequence of operations- push(1), push(2), pop, push(1), push(2), pop, pop,
pop, push(2), pop are performed on a stack, the sequence of popped out values are?
a. 2,2,1,1,2
b. 2,2,1,2,2
c. 2,1,2,2,1
d. 2,1,2,2,2
Answer: a

Queue can be used to implement?


a. Radix sort
b. Quick sort
c. Recursion
d. Depth first search
Answer: a

A machine took 200 sec to sort 200 names, using bubble sort. In 800 sec, it can
approximately sort?
a. 400 names
b. 800 names
c. 750 names
d. 800 names
Answer: a

A machine needs a minimum of 100sec to sort 1000 names by quick sort. The minimum
time needed to sort 100 names will be approximately?
a. 50.2sec
b. 6.7sec
c. 72.7sec
d. 11.2sec
Answer: b

The number of binary trees with 3 nodes which when traversed in post order gives
the sequence A,B,C is?
a. 3
b. 9
c. 7
d. 5
Answer: d

The average search time of hashing with linear probing will be less if the load
factor?
a. Is far less than one
b. Equals one
c. Is far greater than one
d. None of the above
Answer: a

A binary tree that has n leaf nodes. The number of nodes of degree 2 in this tree
is?
a. Log2n
b. N-1
c. N
d. 2n
Answer: b

The principal of locality justifies the use of?


a. Interrupts
b. DMA
c. Polling
d. Cache memory
Answer: d

Sparse matrices have?


a. Many zero entries
b. Many non zero entries
c. Higher dimension
d. None of the above
Answer: a

The postfix expression for *+ab-cd is?


a. ab+cd-*
b. abcd+-*
c. ab+cd*-
d. ab+-cd*
answer: a

what is data structure?


a. Way to organize data
b. Accessing of data elements in specified manner
c. Organization of mathematical and logical concepts
d. All of the above
Answer: d

Which operation is not possible on data structure?


a. Traversing
b. Insertion
c. Reading
d. Deletion
Answer: c

The memory address of the first element is called?


A. Floor address
b. Foundation address
c. First address
d. Base address
Answer: d

The value of first linked list address is?


a. 0
b. -1
c. 1
d. None of the above
Answer: 0

Two dimensional arrays are also called?


a. Matrix array
b. Table array
c. A and b
d. None of the above
Answer: c

The situation in linked list START=NULL is called?


a. Overflow
b. Underflow
c. Both
d. None
Answer: b

Length of the linear array can be found by using the formula?


a. UB LB +1
b. LB + UB
c. LB UB
d. LB UB +1
Answer: a

The restriction while using the binary search is?


a. List should be small in number
b. List should be small in number
c. List should be sorted
d. No restriction
Answer: c

The terms PUSH and POP are related to?


a. Arrays
b. Stacks
c. Linked list
d. None
Answer: b

The operation of processing element is called?


a. Traversing
b. Inserting
c. Deleting
d. Searching
Answer: a

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy