Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. data structure

data structure

Scheduled Pinned Locked Moved Visual Basic
data-structuresperformancequestion
7 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    james_dixon_2008
    wrote on last edited by
    #1

    Heya, Just a quick question. I am writing a stack application in which there is one requirement that data structure must make use of a block of memory allocated when the stack is constructed. Now which data stucture is most appropriate for this. Is it sensible to use linked list or not. ta James

    Richard Andrew x64R V M L 4 Replies Last reply
    0
    • J james_dixon_2008

      Heya, Just a quick question. I am writing a stack application in which there is one requirement that data structure must make use of a block of memory allocated when the stack is constructed. Now which data stucture is most appropriate for this. Is it sensible to use linked list or not. ta James

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      I think you should put on your flame-retardant suit.

      1 Reply Last reply
      0
      • J james_dixon_2008

        Heya, Just a quick question. I am writing a stack application in which there is one requirement that data structure must make use of a block of memory allocated when the stack is constructed. Now which data stucture is most appropriate for this. Is it sensible to use linked list or not. ta James

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        A Linked list, by its very nature, is dynamic; you can't use a stack for it. Unless I'm making a huge mistake (and I've made plenty in the past ;)), you are going to be stuck with arrays*. * You _could_ also use fixed-size stacks and queues and dequeues, but they're just sexed up arrays. :-D

        Cheers, Vikram.


        "If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy

        S L 2 Replies Last reply
        0
        • J james_dixon_2008

          Heya, Just a quick question. I am writing a stack application in which there is one requirement that data structure must make use of a block of memory allocated when the stack is constructed. Now which data stucture is most appropriate for this. Is it sensible to use linked list or not. ta James

          M Offline
          M Offline
          Mustafa Ismail Mustafa
          wrote on last edited by
          #4

          Out! Out! Out! Out damned spot! You have soiled our lounge enough! For this kind of dirty talk you post in the forums! Hence the massive CLICK HERE! tagged with a pretty and upright exclamation point so that you may look at it and eject and stutter your verbal wonder and awe that such technology exists as may transfer you to another page where you could post your response with little fear that black hooded executioners such as many developers you will find crawling through this swamp known as the lounge that happens to be the incorrect location to post programming questions because it is where we lounge[^] and not discuss direct programming questions because those questions are to be posted in the proper location the access of which begins with the blue hyperlink that legibly reads click here.

          "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook "There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib "Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"

          modified on Friday, December 14, 2007 1:11:59 AM

          1 Reply Last reply
          0
          • V Vikram A Punathambekar

            A Linked list, by its very nature, is dynamic; you can't use a stack for it. Unless I'm making a huge mistake (and I've made plenty in the past ;)), you are going to be stuck with arrays*. * You _could_ also use fixed-size stacks and queues and dequeues, but they're just sexed up arrays. :-D

            Cheers, Vikram.


            "If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy

            S Offline
            S Offline
            Sho_Asylumn
            wrote on last edited by
            #5

            Going by Wikipedia, you can use a linked list as the basis of a stack. http://en.wikipedia.org/wiki/Stack_%28data_structure%29#Implementation[^]

            1 Reply Last reply
            0
            • V Vikram A Punathambekar

              A Linked list, by its very nature, is dynamic; you can't use a stack for it. Unless I'm making a huge mistake (and I've made plenty in the past ;)), you are going to be stuck with arrays*. * You _could_ also use fixed-size stacks and queues and dequeues, but they're just sexed up arrays. :-D

              Cheers, Vikram.


              "If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              Vikram A Punathambekar wrote:

              A Linked list, by its very nature, is dynamic; you can't use a stack for it.

              A linked list by it's very nature is in fact a stack without push and pop functions.

              xacc.ide
              IronScheme a R5RS-compliant Scheme on the DLR
              The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

              1 Reply Last reply
              0
              • J james_dixon_2008

                Heya, Just a quick question. I am writing a stack application in which there is one requirement that data structure must make use of a block of memory allocated when the stack is constructed. Now which data stucture is most appropriate for this. Is it sensible to use linked list or not. ta James

                L Offline
                L Offline
                Leslie Sanford
                wrote on last edited by
                #7

                james_dixon_2008 wrote:

                Just a quick question. I am writing a stack application in which there is one requirement that data structure must make use of a block of memory allocated when the stack is constructed. Now which data stucture is most appropriate for this. Is it sensible to use linked list or not.

                Your best bet would be to ask this over at the Mathematics and Algorithms[^] forum. (if it were me, I'd just allocate an array and keep an index to the top of the stack. since you're dealing with a fixed size predetermined from the start, that's how I'd do it.)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups