Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
44 views

Unit1 - Introduction To Data Structure

This document contains 19 multiple choice questions about data structures and sorting algorithms. It covers topics like divide and conquer algorithms like merge sort, priority queue sorting like selection sort, time complexities of sorting algorithms like insertion sort and merge sort, linear and binary search, and properties of different data structures. The answers provided identify merge sort as a divide and conquer algorithm, selection sort as a priority queue sorting, insertion sort as efficient for small n, and binary search as having logn time complexity.

Uploaded by

Rehan Pathan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Unit1 - Introduction To Data Structure

This document contains 19 multiple choice questions about data structures and sorting algorithms. It covers topics like divide and conquer algorithms like merge sort, priority queue sorting like selection sort, time complexities of sorting algorithms like insertion sort and merge sort, linear and binary search, and properties of different data structures. The answers provided identify merge sort as a divide and conquer algorithm, selection sort as a priority queue sorting, insertion sort as efficient for small n, and binary search as having logn time complexity.

Uploaded by

Rehan Pathan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

UNIT -1- INTRODUCTION OT DATA STRUCTURE AND SEARCHING SORTING.

1. Which of the following sorting algorithm is of divide and conquer type?

A. Bubble sort

B. Insertion sort

C. Merge sort

D. Selection sort

Answer: C. Merge sort

2. Which of the following sorting algorithm is of priority queue sorting type?

A. Bubble sort

B. Insertion sort

C. Merge sort

D. Selection sort

Answer:D. Selection sort.

3. …….. sorting algorithm is frequently used when n is small where n is total number of elements.

A. Heap

B. Insertion

C. Bubble

D. Quick

Answer: B. Insertion.

4. Which of the following sorting algorithm is of divide and conquer type?

A. Bubble sort
B. Insertion sort

C. Merge sort

D. Selection sort

Answer:C. Merge sort.

5.…………order is the best possible for array sorting algorithm which sorts n item.

A. O(n logn)

B. O(n2)

C. O(n+logn)

D. O(logn)

Answer: C. O(n+logn)

6. The complexity of merge sort algorithm is ……

A. O(n)

B. O(logn)

C. O(n2)

D. O(n logn)

Answer: D. O(n logn)

7. 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

Answer: B. i-True, ii-False

8.Which of the following is not a limitation of binary search algorithm?

A. must use a sorted array

B. requirement of sorted array is expensive when a lot of insertion and deletions are needed

C. there must be a mechanism to access middle element directly

D. binary search algorithm is not efficient when the data elements more than 1500

Answer: D. binary search algorithm is not efficient .

9. The pointer associated with stack is ......

A. Front

B. Rear

C. Top

D. Link

Answer:C.Top

10. Which out of these is a nonlinear data structure?

A. Arrays

B. Linked list

C. Queues

D. Tree

Answer: D. Tree.
11. Merge sort uses

A.Divided & conquer

B. Backtracking

C. Greedy apparoch

D. Heuristic apparoch

Answer: A. Divided & conquer

12. Where is linear searching used?


A. When the list has only a few elements
B. When performing a single search in an unordered list
C. Used all the time
D. When the list has only a few elements and When performing a single search in an
unordered list
Answer: D. When the list has only a few elements and When performing a single search in an
unordered list

13. What is the best case for linear search?


A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer: D. O(1)

14.What is the worst case for linear search?


A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer: C. O(n)

15.What is the worst case complexity of binary search using recursion?


A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer: B. O(logn)

16. What is the time complexity of binary search with iteration?


A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer: B. O(logn)

17. What is an in-place sorting algorithm?


A. It needs O(1) or O(logn) memory to create auxiliary locations
B. The input is already sorted and in-place
C. It requires additional storage
D. It requires additional space
Answer: A. It needs O(1) or O(logn) memory to create auxiliary locations

18. What is the worst case complexity of bubble sort?


A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer: D. O(n2)

19. What is the average case complexity of bubble sort?


A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer: D. O(n2)

You might also like