Himachal Pradesh SET (HP SET) Data Structures and Algorithms Previous Year Questions
Try the preview and open any solution for a worked explanation.
Himachal Pradesh SET (HP SET) practice pack
The practice pack for Himachal Pradesh SET (HP SET) is coming soon to LawMint.
Question 1
Choose the correct alternative:
(I) Pseudocode is a formal language that helps programmers develop algorithms.
(II) Algorithm is an ordered sequence of steps that describe solution of problem.
Question 2
Given below are two statements :
Statement (I) : A hash function h defined as h (key) = key mod 7, with linear probing, is used to insert the keys 42, 85, 67, 54, 91, 21, 45 into a table indexed from 0 to 6 and the correct position of 91 is 1 and 45 is 6.
Statement (II) : Given a hash table T with 50 slots that stores 2500 elements, the load factor for T is 1/50.
Which statements are correct?
Question 3
Consider two strings A = “rprqq” and B = “prpqrqp”. Let c be the length of the Longest Common Subsequence (LCS) between A and B and let d be the number of such longest common subsequences between A and B. Then calculate the value of c + 10d.
Question 4
If only postorder traversal of a binary search tree (BST) is known then which of the following statement(s) is(are) true ?
Question 5
Consider the following statements :
(i) Best case time complexity of bubble sort can be reduced to O(n).
(ii) The time complexity of Merge sort is O(nlogn) in all the cases.
Which of the following is true ?
Question 6
Given an array of 1 crore pixel intensity values and each of which is an integer in the range [0, 255]. Which sorting algorithm is best ?
Question 7
Consider the following statements :
(i) DFS stands for depth first search and it is implemented with Queue
(ii) Stock span problem can be solved by Stack
(iii) Quicksort shows best behavior when data is sorted in the input. For instance, Array A is {1, 2, 3, 4, 5} and the position of pivot element is located in the starting of array. On the contrary, worst behavior when data is in descending order like A is {5, 4, 3, 2, 1}
(iv) 6 types of rotations are used in splaying of a splay tree, whereas in AVL 4 types of rotations are possible
Which of the above statements is/are correct ?
Question 8
Consider the following :
(i) Both forward and backward traversals are possible.
(ii) Elements in the list must be in a sorted order.
(iii) The last node in the list points to the header node.
Which of the following statement(s) is (are) true about a circular singly linked list ?
Question 9
Arrange the time complexities in increasing order :
(i)
(ii) O(n log n)
(iii)
(iv) O(log n)
Question 10
Match List-I with List-II:
| List-I (Data Structure Name) | List-II (Type) |
|---|---|
| (a) Linked List | (i) Holds many to many relationship |
| (b) Array | (ii) Static data structure |
| (c) Tree | (iii) Dynamic data structure |
| (d) Graph | (iv) Holds 1 to many relationship |
Previous papers with Data Structures and Algorithms questions
Himachal Pradesh SET (HP SET) practice pack
The practice pack for Himachal Pradesh SET (HP SET) is coming soon to LawMint.