I’ve introduced the Queue structure in previous post. In contiguous storage, queues were significantly harder to manipulate than were stacks, because it was necessary to treat straight-line storage as though it were arranged in a circle, and the extreme cases of full queues and empty queues caused difficulties. As a result, I introduce you the linked queue in this post.
I’ve introduced the Stack structure in previous post. But considering the efficiency when we operating the entries, you may find that using an array(static one) is not good enough. So in this post, I’ll show you a whole new way to store elements——Linked Structure.
The advantage of linked structure is that it’s convenient to insert or delete element in any position. There won’t be a problem about moving elements. But its setback is also abvious, that is, you can’t randomly access an element unless it is head or back(if possible).
This post will give a general introduction of Queue, and some of its basic operations.
Similar to its meaning in ordinary English, a queue is defined as a waiting line, like a line of people waiting to purchase tickets, where the first person in line is the first person served.For computer applications, we similarly define a queue to be a list in which all additions to the list are made at one end, and all deletions from the list are made at the other end. Queues are also called first-in first-out lists, or FIFO.
The entry in a queue ready to be served, that is, the first entry that will be removed from the queue, is called the front of the queue. Similarly, the last entry in the queue, that is, the one most recently append, is called the rear of the queue.
This post will give a general introduction of Stack, and some of its basic operations.
A stack is a version of a list that is particularly useful in applications involving reversing. In a stack data structure, all insertions and deletions of entries are made at one end, called the top fo the stack, which is also the only position that a user can manipulate the entries.
When it comes to the operations, we talk about push and pop. When we add an item to a stack, we usually say that we push it onto the stack. And when we remove an item, we usually say that we pop it from the stack. So, noted that the last item pushed onto a stack is always the first data to be removed from the stack. This special property is called last in first out, or LIFO.
Today, I’d like to introduce you how to compile and execute a C program. As we known, C is an advanced programming language, there are four steps for producing a C program:Preprocess, Compile, Link and Execution.
First, a corrected C file without any syntax mistake is needed. Then you can use IDE or Command-Line to compile it.
This is my personal tech blog, where I will introduce some programming knowlegdes.
I have to admit that I am not a proficient or professional programmer. Instead, I am just a novice I suppose. So if there is any technical mistakes or problem, you’re welcomed to comment or send an email to me. Your suggestions or comments will be highly valued.
Now you execute the program and you can see the text on your screen. It’s simple but a good begin. Now enjoy coding!