English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

some practical applications such as in banking,operating systems etc.

2006-12-08 03:28:11 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

The basic data structures, such as a stack and a queue, are the fundamentals of programming concepts. Other data structures are built on top of these concepts.

Consider the stack. The first item to go in to a stack is the last item out. Practical application? Browser history is probably implemented as a stack. Mathematical software usually breaks a function down into a series of operations placed in a stack, so the operations of highest precedence (exponents, multiplication, items in parentheses) are at the top of the stack.

Queue? Consumer/producer types of applications, such as a job submission and job control application. Banking operations need to process transactions sequentially, but have no control when these transactions occur, so they go into a process queue.

Hope that helps.

2006-12-08 12:00:14 · answer #1 · answered by rons_brain 2 · 0 0

Stacks are LIFO (Last In First Out) which means that the last piece of data that was added to the stack is the only one that can be operated on until it is removed from the stack and then the next lower piece can be worked with. As far as practical applications, that is going to depend on the particular problem the programmer was working on when he/she was writing the code.A queue is FIFO (First In First Out) so whatever piece of data was put in first is the first one operated on. This is generally what the kernel of an operating system uses to deal with resource requests and CPU time (also taking into account priority signals).

2006-12-08 03:34:47 · answer #2 · answered by Chris S 5 · 0 0

stacks and queues are a low level mechanism used to organize and control data. machine language programmers access these (as well as other low level languages) to transfer information in your processor. At the application level, you will never need to deal with this sort of thing.

2006-12-08 03:35:20 · answer #3 · answered by Roy In Atlanta 1 · 0 0

fedest.com, questions and answers