Programmers/developers alike write programs using computer languages that usually are close to human languages. These languages are called High Level Languages like Java, C++ and C#. But they differ in the way they execute their code; some of them are compiled and the rest are interpreted. Compiled languages take the entirety of the file and compile it as a unit. It takes takes time and generates errors after scanning everything. But that's not the case with interpreted languages, where they translate code statement at a time and memory efficient since there's no need to generate an intermediate object code.
Stack is like a pile of books placed on top of each other. We can add new books to the top and can remove them from only the top because stacks are LIFO which means last-in, first-out. Queues on the other hand are the opposite, which is FIFO meaning first-in, first-out. So adding an element to the queue will be the same but removing will happen to the first element not the last one. An example of a queue would be the wait line in front of any kind of service we see around us like the bus station or the shops,....etc.
Comments
Post a Comment