When would you use a stack as opposed to a regular linked list or a regular queue as opposed to a priority...












-1















In my CS2 class, we are learning a lot of syntax for stacks, queues, and linked lists. Despite this, we haven't actually learned any applications of them or been told how to tell when we should use one data structure vs the other. Does anyone know of a resource to better understand differing applications of these varying data structures?










share|improve this question





























    -1















    In my CS2 class, we are learning a lot of syntax for stacks, queues, and linked lists. Despite this, we haven't actually learned any applications of them or been told how to tell when we should use one data structure vs the other. Does anyone know of a resource to better understand differing applications of these varying data structures?










    share|improve this question



























      -1












      -1








      -1








      In my CS2 class, we are learning a lot of syntax for stacks, queues, and linked lists. Despite this, we haven't actually learned any applications of them or been told how to tell when we should use one data structure vs the other. Does anyone know of a resource to better understand differing applications of these varying data structures?










      share|improve this question
















      In my CS2 class, we are learning a lot of syntax for stacks, queues, and linked lists. Despite this, we haven't actually learned any applications of them or been told how to tell when we should use one data structure vs the other. Does anyone know of a resource to better understand differing applications of these varying data structures?







      java linked-list stack queue computer-science






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 6 '18 at 17:46







      Person

















      asked Nov 25 '18 at 15:28









      PersonPerson

      296




      296
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Stacks, queues, priority queues are very versatile data structures.



          You can find their uses in Competitive Programming, Processors, Operating Systems, and a lot more places I have not yet explored.



          As a Computer Science student, you will learn more about it in the future, when you take up courses like Computer Organization and OS.



          This answer explains the use of stacks in a microprocessor. A processor also uses Priority Queues to prioritize tasks, like handling of interrupts. Severe interrupts are given high priority, and mild interrupts are given less priority.



          Another use of the stack is in recording the trace-back for a software which just hit an exception (run-time usually). A python reference is attached here.



          According to me, these data structures don't need much practicing. You just need to know the crux of it. You should know what is the use of stack (Last In First Out), Queues, etc.
          However, priority queues are a bit more complex (in implementation), and you can always have a brush-up on it, if you want to implement it.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53469001%2fwhen-would-you-use-a-stack-as-opposed-to-a-regular-linked-list-or-a-regular-queu%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Stacks, queues, priority queues are very versatile data structures.



            You can find their uses in Competitive Programming, Processors, Operating Systems, and a lot more places I have not yet explored.



            As a Computer Science student, you will learn more about it in the future, when you take up courses like Computer Organization and OS.



            This answer explains the use of stacks in a microprocessor. A processor also uses Priority Queues to prioritize tasks, like handling of interrupts. Severe interrupts are given high priority, and mild interrupts are given less priority.



            Another use of the stack is in recording the trace-back for a software which just hit an exception (run-time usually). A python reference is attached here.



            According to me, these data structures don't need much practicing. You just need to know the crux of it. You should know what is the use of stack (Last In First Out), Queues, etc.
            However, priority queues are a bit more complex (in implementation), and you can always have a brush-up on it, if you want to implement it.






            share|improve this answer




























              1














              Stacks, queues, priority queues are very versatile data structures.



              You can find their uses in Competitive Programming, Processors, Operating Systems, and a lot more places I have not yet explored.



              As a Computer Science student, you will learn more about it in the future, when you take up courses like Computer Organization and OS.



              This answer explains the use of stacks in a microprocessor. A processor also uses Priority Queues to prioritize tasks, like handling of interrupts. Severe interrupts are given high priority, and mild interrupts are given less priority.



              Another use of the stack is in recording the trace-back for a software which just hit an exception (run-time usually). A python reference is attached here.



              According to me, these data structures don't need much practicing. You just need to know the crux of it. You should know what is the use of stack (Last In First Out), Queues, etc.
              However, priority queues are a bit more complex (in implementation), and you can always have a brush-up on it, if you want to implement it.






              share|improve this answer


























                1












                1








                1







                Stacks, queues, priority queues are very versatile data structures.



                You can find their uses in Competitive Programming, Processors, Operating Systems, and a lot more places I have not yet explored.



                As a Computer Science student, you will learn more about it in the future, when you take up courses like Computer Organization and OS.



                This answer explains the use of stacks in a microprocessor. A processor also uses Priority Queues to prioritize tasks, like handling of interrupts. Severe interrupts are given high priority, and mild interrupts are given less priority.



                Another use of the stack is in recording the trace-back for a software which just hit an exception (run-time usually). A python reference is attached here.



                According to me, these data structures don't need much practicing. You just need to know the crux of it. You should know what is the use of stack (Last In First Out), Queues, etc.
                However, priority queues are a bit more complex (in implementation), and you can always have a brush-up on it, if you want to implement it.






                share|improve this answer













                Stacks, queues, priority queues are very versatile data structures.



                You can find their uses in Competitive Programming, Processors, Operating Systems, and a lot more places I have not yet explored.



                As a Computer Science student, you will learn more about it in the future, when you take up courses like Computer Organization and OS.



                This answer explains the use of stacks in a microprocessor. A processor also uses Priority Queues to prioritize tasks, like handling of interrupts. Severe interrupts are given high priority, and mild interrupts are given less priority.



                Another use of the stack is in recording the trace-back for a software which just hit an exception (run-time usually). A python reference is attached here.



                According to me, these data structures don't need much practicing. You just need to know the crux of it. You should know what is the use of stack (Last In First Out), Queues, etc.
                However, priority queues are a bit more complex (in implementation), and you can always have a brush-up on it, if you want to implement it.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 25 '18 at 15:43









                MaJoRMaJoR

                536115




                536115
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53469001%2fwhen-would-you-use-a-stack-as-opposed-to-a-regular-linked-list-or-a-regular-queu%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Costa Masnaga

                    Fotorealismo

                    Sidney Franklin