1.

Which of the following is not the method to represent Sparse Matrix?(a) Dictionary of Keys(b) Linked List(c) Array(d) HeapI want to ask this question from Arrays Types topic in division Arrays Types of Data Structures & Algorithms II have been asked this question in a job interview.

Answer»

The correct choice is (d) Heap

Easy explanation - Heap is not used to represent SPARSE Matrix while in Dictionary, rows and column numbers are used as Keys and values as Matrix entries, Linked List is used with each node of Four fields (Row, Column, Value, NEXT Node) (2D array is used to represent the Sparse Matrix with THREE fields (Row, Column, Value).



Discussion

No Comment Found

Related InterviewSolutions