Data structure MCQ Quiz Hub

Data Structure and Algorithms (DSA) set 2

Choose a topic to test your knowledge and improve your Data structure skills

how many vlue can held by an array A(-1…m,1…m)?





✅ Correct Answer: 4

let x be the adjacency matrix of a graph .G with no self loop.The entries along the principle diagonal of x are





✅ Correct Answer: 1

__ refers to the operation of finding the location of a given item in a collection of items.





✅ Correct Answer: 2

______ is a field whose values uniquely determine the records in the file.





✅ Correct Answer: 2

By using which of the following methods sorting is not possible?





✅ Correct Answer: 4

Which is the simplest file structure?





✅ Correct Answer: 1

A ______ is a data structure use foe a storage of a records.





✅ Correct Answer: 2

_____ is a search for data that uses an index to locate the item.





✅ Correct Answer: 3

If the input array is unsorted, then only a linear ______ can be used.





✅ Correct Answer: 2

____ is a attribute of a sort, indicating that data with equal keys maintain their relative input order in the output.





✅ Correct Answer: 2

In ______ method of hashing, selected digit are extracted from the key and used as the address.





✅ Correct Answer: 2

_____ hashing method is used in combination with other methods.





✅ Correct Answer: 3

If two different keys yield the same hash address, it is called _______ .





✅ Correct Answer: 3

The ______ sort algorithm is called diminishing increment sort.





✅ Correct Answer: 3

A ______ merge sort uses a constant number of input merge files and the same number of output merge files.





✅ Correct Answer: 2

___ method of collision resolution involves maintaining two tables in memory.





✅ Correct Answer: 2

____ is a merge sort that sorts a data stream using repeated merges.





✅ Correct Answer: 4

One of the statement is false





✅ Correct Answer: 3

Examples of sorting algorithms are





✅ Correct Answer: 4

Give timing complexities of three sorting algorithms bubble sort,selection sort,insertion sort respectively.





✅ Correct Answer: 2

__passes are required to sort n data using bubble sort.





✅ Correct Answer: 2

Best and the worst case timing complexities of insertion sort are_________.





✅ Correct Answer: 3

Which sorting algorithm can exploit the partially sorted data in a list?





✅ Correct Answer: 3

Sorting is useful for_________





✅ Correct Answer: 3

The getch() library function returns___





✅ Correct Answer: 1

a character when enter is pressed





✅ Correct Answer: 1

A variable P is called pointer if__ A.





✅ Correct Answer: 1

Which of the following data structure can't store the non-homogeneous data element?





✅ Correct Answer: 1

The difference between linear array and a record is_____





✅ Correct Answer: 4

If s1 is "ABC" and s2 is "DEF" then strcat(s1,s2)will give the following result.





✅ Correct Answer: 1

Give output of the following programint main(){inta[]={2,3,4,5,6};printf("%d",2[a]);}





✅ Correct Answer: 3

Where do we use the operator --> ?





✅ Correct Answer: 4

The function strcmp(s1,s2)will return -1 if____





✅ Correct Answer: 3

The number of comparisons required to sort 5 numbers in ascending order using bubble sort are





✅ Correct Answer: 3

A sorting algorithm is stable if





✅ Correct Answer: 2

The average case complexity of Insertion Sort is





✅ Correct Answer: 3

A sorted file contains 16 items. Using binary search, the maximum number of comparisons to search for an item in this file is





✅ Correct Answer: 4

A sort which compares adjacent elements in a list and switches where necessary is





✅ Correct Answer: 4

A sort which iteratively 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





✅ Correct Answer: 2

The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order, using bubble sort is





✅ Correct Answer: 4

A sorting technique that guarantees that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be





✅ Correct Answer: 1

You want to check whether a given set of items is sorted. Which of the following sorting methods will be most efficient if it is already in sorted order?





✅ Correct Answer: 3

Which of the following sorting methods will be the best if number of swappings done, is the only measure of efficienty?





✅ Correct Answer: 2

You are asked to sort 15 randomly generated numbers. You should prefer





✅ Correct Answer: 1

What is the number of swaps required to sort n elements using selection sort, in the worst case?





✅ Correct Answer: 1

The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is





✅ Correct Answer: 2

The smallest element of an array’s index is called its





✅ Correct Answer: 1

Which of the following sorting methods would be most suitable for sorting a list which is almost sorted





✅ Correct Answer: 1

. A sort which compares adjacent elements in a list and switches wherever necessary is _______





✅ Correct Answer: 2

Which of the following sorting method is the slowest?





✅ Correct Answer: 4

In bubble sort,for a file of size n,after p iterations number of records in proper position is____





✅ Correct Answer: 1

In bubble sort,for a file of size n,during each pth pass the number of last records left out are___





✅ Correct Answer: 4

Given a file size n the number of times a given file is passed through in bubble sort is____





✅ Correct Answer: 1

Total number of comparision in bubble sort is____





✅ Correct Answer: 2

The selection sort is basically a method of repeated





✅ Correct Answer: 3