191CSC303T - DS - Unit 1
191CSC303T - DS - Unit 1
PART-A
Disadvantages:
Nodes of a linked list cannot be accessed directly. To access a particular node accessing
should start only from the beginning.
To store a single data, along with data, memory must be allocated for a pointer also, which
wastes memory.
16. Write the steps required to evaluate the postfix expression.
Repeatedly read characters from postfix expression
If the character read is an operand, push the value associated with it into the stack
If it is an operator, pop the top two values from stack, apply the operator to them and push the
result back onto the stack.
19. What are the disadvantages of linked list over array? (NOV/DEC 2018)
Random access is not allowed. We have to access elements sequentially starting from the first node.
So we cannot do a binary search with linked lists.
Extra memory space for a pointer is required with each element of the list.
Arrays have better cache locality that can make a pretty big difference in performance.
21. What are the disadvantages of using simple array implementation of lists? (April/May
2018)
22.
PART-B