WorksheetsQuiz82-DS
Total questions: 45
Worksheet time: 23mins
Identify the odd data structure from the following
A. Array
B. Stack
C. Queue
D. Tree
A
B
C
D
Which of the following data structure can't store the non-homogeneous data elements?
A. Arrays B. Records C. Pointers D. Stacks
A
B
C
D
Which of the following is non-liner data structure?
A. Stacks B. List C. Strings D. Trees
A
B
C
D
The advantage of …………….. is that they solve the problem if sequential storage representation.
But disadvantage in that is they are sequential lists.
A. Lists B. Linked Lists C. Trees D. Queues
A
B
C
D
Which of the following data structures are indexed structures?
A. Linear arrays B. Linked lists C. Queue D. Stack
A
B
C
D
Which of the following data structure store the homogeneous data elements?
A. Array B. Records C. Pointers D. None of these
A
B
C
D
When new data are to be inserted into a data structure, but there is not available space; this situation is usually called ....
A. Underflow B. overflow C. houseful D.saturated
A
B
C
D
A data structure where elements can be added or removed at either end but not in the middle is called ...
A. linked lists B.stacks C. queues D. dequeue
A
B
C
D
Operations on a data structure may be ......
A. creation B. destruction C. selection D. all of the above
A
B
C
D
Which of the following are the operations applicable an primitive data structures?
A. create B. destroy C. update D. all of the above
A
B
C
D
The use of pointers to refer elements of a data structure in which elements are logically adjacent is ....
A. pointers B. linked allocation C. stack D. queue
A
B
C
D
A data structure in which elements can be inserted from one end and deleted from other end but not in the middle is?
A. Queue B. Circular queue C. Dequeue D. Priority queue
A
B
C
D
The variable which can be accessed by all the models is known as ______________
A. Local Variable B. Global Variable C. Internal variable D. External variable
A
B
C
D
Which of the following ADT can represent a many to many relationship?
A. Tree only
B. Graph only
C. Array only
D. Both array and graph
A
B
C
D
Data structure means
A. Organizing data
B. Processing data
C. Searching data
D. Organizing and Processing the data
A
B
C
D
Which of the following data structure gives overflow even though a current n element in it is less than its size?
A. Stack
B. Circular queue
C. Linked List
D. Simple queue
A
B
C
D
Which of the following is not required for recursive function?
A. Base case
B. Recursive case
C. Both Base and Recursive case
D. None of these
A
B
C
D
As a data structure, a stack is most analogous to
A. a super market
B. a small family of weebles
C. a cafeteria tray dispenser
D. All of above
A
B
C
D
Which of the following is consider to be nonlinear data structure?
A. Linked list
B. Tree
C. Both
D. None of above
A
B
C
D
We can have float value cases in switch statement.
A. True B. False
A
B
An array is a collection of
A. Different data types scattered throughout memory
B. The same data type scattered throughout memory
C. The same data type placed next to each other in memory
D. Different data typed placed next to each other in memory
A
B
C
D
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
A
B
C
D
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
A
B
C
D
What is the output of this C code?
#include <stdio.h>
void main()
{
int a[2][3] = {1, 2, 3, 4, 5};
int i = 0, j = 0;
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
printf("%d", a[i][j]);
}
A. 1 2 3 4 5 0
B. 1 2 3 4 5 junk
C. 1 2 3 4 5 5
D. Run time error
A
B
C
D
Comment on the 2 arrays regarding P and Q:
int *a1[8];
int (*a2)[8];
P. Array of pointers
Q. Pointer to an array
A. a1 is P, a2 is Q
B. a1 is P, a2 is P
C. a1 is Q, a2 is P
D. a1 is Q, a2 is Q
A
B
C
D
An array elements are always stored in ________ memory locations.
A. Sequential
B. Random
C. Sequential and Random
D. None of the above
A
B
C
D
What is right way to Initialize array?
A. int num[6] = { 2, 4, 12, 5, 45, 5 };
B. int n{} = { 2, 4, 12, 5, 45, 5 };
C. int n{6} = { 2, 4, 12 };
D. int n(6) = { 2, 4, 12, 5, 45, 5 };
A
B
C
D
What will be the output of the program ?
#include<stdio.h>
void main()
{
int a[5] = {5, 1, 15, 20, 25};
int i, j, m;
i = ++a[1];
j = a[1]++;
m = a[i++];
printf("%d, %d, %d", i, j, m);
}
A. 3, 2, 15
B. 2, 3, 20
C. 2, 1, 15
D. 1, 2, 5
A
B
C
D
#include <stdio.h>
int main(void)
{
char p;
char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};
p = (buf + 1)[5];
printf("%d", p);
return 0;
}
A. 5
B. 6
C. 9
D. Error
A
B
C
D
Let x be an array. Which of the following operations are illegal?
I. ++x
II. x+1
III. x++
IV. x*2
A. I and II
B. I, II and III
C. II and III
D. I, III and IV
A
B
C
D
What is the maximum number of dimensions an array in C may have?
A. 2
B. 8
C. 20
D. Theoretically no limit. The only practical limits are memory size and compilers.
A
B
C
D
Size of the array need not be specified, when
A. Initialization is a part of definition
B. It is a declaration
C. It is a formal parameter
D. All of these
A
B
C
D
What will be printed after execution of the following code?
void main()
{
int arr[10] = {1,2,3,4,5};
printf("%d", arr[5]);
}
A. Garbage Value
B. 5
C. 6
D. 0
A
B
C
D
What will be the output of the following code?
void main()
{
int a[10];
printf("%d %d", a[-1], a[12]);
}
A. 0 0
B. Garbage value 0
C. 0 Garbage Value
D. Garbage value Garbage Value
A
B
C
D
Array passed as an argument to a function is interpreted as
A. Address of the array.
B. Values of the first elements of the array.
C. Address of the first element of the array.
D. Number of element of the array.
A
B
C
D
What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes?
#include<stdio.h>
void main()
{
int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
printf("%u, %u", a+1, &a+1);
}
A. 65474, 65488
B. 65480, 65488
C. 65480, 65496
D. 65474, 65476
A
B
C
D
In linked list each node contain minimum of two fields. One field is data field to store the data second field is?
A. Pointer to character
B. Pointer to integer
C. Pointer to node
D. Node
A
B
C
D
Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?
A. Deleting a node whose location in given
B. Searching of an unsorted list for a given item
C. Inverting a node after the node with given location
D. Traversing a list to process each node.
A
B
C
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
A
B
C
D
In a circular linked list
A. Components are all linked together in some sequential manner.
B. There is no end.
C. Components are arranged hierarchically.
D. Forward and backward traversal within the list is permitted.
A
B
C
D
What would be the asymptotic time complexity to add an element in the end of the linked list?
A.O(1)
B. O(n)
C. O(n2)
D. None
A
B
C
D
A variant of linked list in which last node of the list points to the first node of the list is?
A. Singly linked list
B. Doubly linked list
C. Circular linked list
D. Multiply linked list
A
B
C
D
What kind of linked list is best to answer question like “What is the item at position n?”
A.Singly linked list
B. Doubly linked list
C. Circular linked list
D. Array implementation of linked list
A
B
C
D
In worst case, the number of comparison need to search a singly linked list of length n for a given element is
A. log n
B. n/2
C. log2n-1
D. n
A
B
C
D
