Posted On: Feb 22, 2018
Stack | Queue |
It follows the principle of LIFO (last in first out). | It follows the principle of FIFO (first in first out). |
It performs the operation of push and pop. | It performs the operation of Enqueue and dequeue. |
The implementation is simpler here. | The implementation is comparatively complex. |
Stack does not consist of variants. | Queue contains variants like priority queue etc. |
Never Miss an Articles from us.
The STP also stands for Spanning Tree Protocol constructs a loop-free logical topography for Ethernet networks. It is a ..
A prime number is a whole number greater than 1, which is only divisible by 1 and itself. // function check whether a number // is prime or not bool isPrime(int n) { // Corner case if (n...
A regular expression to validate phone number in XXX-XXX-XXXX format is follows: /^(?:\(\d{3}\)|\d{3}-)\d{3}-\d{4}$/...