I realized that we cannot access size of some structurest directly like stack, queue. We were have to access size by other objects like linkedlist.toArray().size. That is why i added size func. inside linkedlist using toArray func and i called size func. of linkedlist inside other structures.(stack, queue, doublylindkedlist.) Now we can directly access size inside data structures like stack and queue.
I realized that we cannot access size of some structurest directly like stack, queue. We were have to access size by other objects like linkedlist.toArray().size. That is why i added size func. inside linkedlist using toArray func and i called size func. of linkedlist inside other structures.(stack, queue, doublylindkedlist.) Now we can directly access size inside data structures like stack and queue.