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

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




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




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




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




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




6. Which is the simplest file structure?




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




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




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




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




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




12. _____ hashing method is used in combination with other methods.




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




14. The ______ sort algorithm is called diminishing increment sort.




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




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




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




18. One of the statement is false




19. Examples of sorting algorithms are




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




21. __passes are required to sort n data using bubble sort.




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




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




24. Sorting is useful for_________




25. The getch() library function returns___




26. a character when enter is pressed




27. A variable P is called pointer if__ A.




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




29. The difference between linear array and a record is_____




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




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




32. Where do we use the operator --> ?




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




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




35. A sorting algorithm is stable if




36. The average case complexity of Insertion Sort is




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




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




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




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




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




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




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




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




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




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




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




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




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




50. Which of the following sorting method is the slowest?




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




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




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




54. Total number of comparision in bubble sort is____




55. The selection sort is basically a method of repeated