You are writing a program to hold nodes structures for some
Solution
2) a) Deletion is more efficient and easy in LL than in array as the storage is consective in array as only value of pointer is needed to change in LL.
b) Finding total size is easy in LL as the memory of array is fixed, we must know upper limit it in advance.
c) Inserting an element in an array is more expensive than in LL as the room should be created for every insertion
d) In array the element can be assced randomly but in LL it is sequential. So its easy in array.
e) Same as both requires O(n) in worst case.
3) Queue: X L A
Queue: L A as * came
Queue: A as * came
Queue: A Z M V O
Queue: Z M V O as * came
Queue: Z M V O U
Queue: M V O U as * came
Queue: M V O U T S
Queue: V O U T S as* came
Queue: O U T S as* came
With Priority Queue
PQ:X, PQ: L X PQ: A L X PQ: L X PQ: X PQ: X Z PQ: M X Z PQ: M V X Z PQ: M O V X Z PQ: O V X Z PQ: O U V X Z PQ: U V X Z PQ: T U V X Z PQ: S T U V X Z PQ: T U V X Z PQ: U V X Z
