![]() ![]() For instance, programming languages usually use a stack structure to pass variables to functions. So, you could break your program in a part that reads data from some input, does some processing and writes them in a queue and a part that retrieves data from the queue processes them and stores them in another queue for further processing or transmitting the data.Ī stack can be helpful when you need to temporarily store an element that is going to be used in the immediate step(s) of your program. In all of these cases you need the sequence of the elements to be output in the same order as they came into your program, otherwise the information may stop making sense. Or when you do any type of store and forward processing. For instance when you process an audio stream or when you buffer network data. ![]() And the rest are just hiding this fact behind the language jargon<Ī queue can be helpful when the order of the elements is important and needs to be exactly the same as when the elements first came into your program. In most cases, though it is actually either a value or a memory location (i.e. This abstract information entity called element could be anything, from a pointer, a value, a string or characters, an object. I am using the abstract wording of retrieve/remove in this context because there are instances when you just retrieve the element from the chain or in a sense just read it or access its value, but there also instances when you remove the element from the chain and finally there are instances when you do both actions with the same call.Īlso the word element is purposely used in order to abstract the imaginary chain as much as possible and decouple it from specific programming language
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |