My Report (&Account)

Suffix Array Test


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)

1. Which of the following is the disadvantage of sparse matrices over normal matrices?

2. Choose the appropriate code that counts the number of non-zero(non-null) elements in the sparse array.

3. Which of the following performs the fetch operation?

4. When do you use a sparse array?

5. Choose the code which performs the store operation in a sparse array.(Linked list implementation)

6. Suppose the contents of an array A are, A = {1, null, null, null, null, 10};
What would be the size of the array considering it as a normal array and a sparse array?

7. What is a sparse array?

8. What is sparsity of a matrix?

9. What is the functionality of the following piece of code?

public Object function(int row_index, int col_index)
{
        if (row_index < 0 || col_index > N)
	{
            System.out.println("column index out of bounds");
			return;
	}
        return (sparse_array[row_index].fetch(col_index));
}

10. What is the difference between a normal(naive) array and a sparse array?


 

Start practicing “1000 MCQs on Data Structure”, and once you are ready, you can take tests on all topics by attempting our “Data Structure Test Series”.

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.