NEW
Font size
S
M
L
XL
Worksheetscoding skills(ISCP 02) Tuesday slot3 (2.00pm - 4:00pm) CSE X & Z
Total questions: 20
Worksheet time: 20mins
Name
Class
Date
1.
The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?
a)
600
b)
350
c)
650
d)
588
2.
How many variables are required to implement a queue using arrays?
a)
1
b)
2
c)
3
d)
4
3.
Stack can be implemented which of the following concepts?
a)
Array
b)
Linked list
c)
Both a and b
d)
Trees
4.
The process of deleting an element from the queue is called?
a)
pop operation
b)
push operation
c)
enqueue operation
d)
dequeue operation
5.
The process of inserting an element into the stack is called?
a)
pop operation
b)
push operation
c)
underflow operation
d)
dequeue operation
6.
Which of the data structure follows LIFO principle?
a)
Stack
b)
Queue
c)
Linked list
d)
Tree
7.
If REAR, FRONT are the queue variables, then identify correct statement while deleting a value
a)
FRONT=FRONT+1
b)
REAR=REAR+1
c)
REAR=REAR-1
d)
FRONT=FRONT-1
8.
Which of the following is not a stable sorting algorithm?
a)
Merge sort
b)
Quick sort
c)
Bubble sort
d)
Selection sort
9.
Binary search algorithm can be applicable on …
a)
sorted linked list
b)
unsorted linear array
c)
sorted linear array
d)
pointer array
10.
If the elements of an array are sorted or almost then …… sorting can be efficient.
a)
Heap
b)
Insertion
c)
Selection
d)
Merge
11.
The time complexity of selection sort algorithm is …..
a)
O(n)
b)
O(logn)
c)
O(n**2)
d)
O(n logn)
12.
Which of the following is sorting algorithm categorised as divide conquer
a)
Radix sort
b)
Quick sort
c)
Merge sort
d)
Both b and c
13.
What is the best case complexity of insertion sort?
a)
O(n)
b)
O(n**2)
c)
O(nlogn)
d)
O(n**3)
14.
If REAR, FRONT are the queue variables, then identify correct statement while inserting a value
a)
FRONT=1
b)
REAR=REAR+1
c)
REAR=REAR-1
d)
FRONT=FRONT-1
15.
Condition to check stack is overflow is?
a)
top==-1
b)
top==0
c)
top==1
d)
top==MAXSIZE
16.
Complexity of Partition technique in quicksort is ……..
a)
O(n)
b)
O(2**n)
c)
O(n**2)
d)
O(logn)
17.
Maximum possible number of swappings in selection sort on an n elemented integer array?
a)
n
b)
n*(n-1)/2
c)
n*(n+1)*(n+2)/2
d)
(n-1)*n*(n+1)/2
18.
Formula for circular queue dequeue operation?
a)
rear=(rear+1)%qsize
b)
front=(front-1)%qsize
c)
front=(front+1)%qsize
d)
rear=(rear+1)%qsize
19.
State True or False for internal sorting algorithms.
i) Internal sorting are applied when the entire collection if data to be sorted is small enough that the sorting can take place within main memory.
ii) The time required to read or write is considered to be significant in evaluating the performance of internal sorting.
a)
i-True, ii-True
b)
i-True, ii-False
c)
i-False, ii-True
d)
i-False, ii-False
20.
int binarySearch(int arr[], int n, int target) {
int left = 0;
int right = n - 1;
while (left < right) {
int mid = left + (right - left) / 2;
if (arr[mid] == target)
return mid;
else if (arr[mid] < target)
left = mid;
else
right = mid;
}
return -1;
}
What issue or error is present in this code snippet?
a)
There is no issue; the code is correct.
b)
The loop condition should be left <= right.
c)
The left and right updates should be left = mid + 1 and right = mid - 1.
d)
The target element is not correctly returned.
Reset
