Q1) application of stacks: 1. Expression Evaluation 2. Expression Conversion i. Infix to Postfix ii. Infix to Prefix iii. Postfix to Infix iv. Prefix to Infix 3. Backtracking application of queues : 1) When a resource is shared among multiple consumers. Examples include CPU scheduling, Disk Scheduling. 2) When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes. Examples include IO Buffers, pipes, file IO, etc. Q2) Sparsh matrix: A sparse matrix is a matrix in which many or most of the elements have a value of zero . This is in contrast to a dense matrix, where many or most of the elements have a non-zero value. a sparse matrix, substantial memory requirement reductions can be realized by storing only the non-zero entries. Depending on the number and distribution of the non-zero entries, different data structures can be used and yield huge savings in memory when compared to th...
Comments
Post a Comment