Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# Question about learning C++ Linked Lists before Stacks...

  1. Oct 6, 2016 #1
    i wanted to ask you that in c++it is important we should learn linked list before learning stack,queue that i wanted to know while studying data structures
     
  2. jcsd
  3. Oct 6, 2016 #2

    jedishrfu

    Staff: Mentor

    I think it depends on whether the stacks and queues are implemented using linked lists or not.

    Simple fixed size stacks and queues can be implemented using a couple of pointers and an array.

    Linked lists allow for making more flexible variable sized stacks and queues.
     
  4. Oct 6, 2016 #3

    QuantumQuest

    User Avatar
    Gold Member

    Agree to jedishrfu. In general, things when learning C or C++, go the other way around (first simple stacks and queues using pointers then linked lists) which is equally effective. But, the way you describe can serve well too.
     
  5. Oct 6, 2016 #4
    yes as linked list is not there in syllabus in our high school
    i asked because there were programs given using linked list implemention of stack
    so i asked we should know linked list before stack,queue
    i got the answer
    once again you solved mu confusion and doubt

    thanks sir
     
  6. Oct 6, 2016 #5



    okay sir
    i understood
    thanks you sir for clearing for confusion

    once again thanks
    your answer is helping me computer science in c++ in high school class 12
    thanks
     
  7. Oct 6, 2016 #6
    The C++ is not relevant, the data structure is universal. As lon as you understand the concept, you can implement them in any language.

    I doubt very many stacks are implemented with lists. You can really implement them in many different ways as long as they satisfy the criteria.
     
  8. Oct 6, 2016 #7

    yes right through array . pointers,structures
    thanks
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Question about learning C++ Linked Lists before Stacks...
Loading...