Is it possible to ignore one from a stack or queue algorithm? Which one you think is useless and why?
No its not possible both of them have their own importance as the stack is used in implementing recursion because of its Last in First out property.
Queues are used for scheduling the programs.
But if still, we have to choose one of them then it would be stack as scheduling is important and not able to implement recursive programs can be taken care of as we can convert any recursive program to an iterative solution but the implementation can be difficult but its possible.
Get Answers For Free
Most questions answered within 1 hours.