Some times after u have hardcoded the limits of your stack in your code the only way to increase its size is by recompiling the changed code ! Hence you can take the advantage of linked lists whose growth is limited only by the amount of physical memory you might have. This is what was told to us during our grad days .. not long may be 2 years back only. Linked lists were fun but i was always confused with the fact that ... perhaps it would take a longer time to find a particular element cuz what you have is the start pointer only which means for every search you will have to pass thrugh all elements on the list ... now that is unnecessary overhead. That also depends if in case the element you were searching in on the first place .. LUCKY U ... but if the same element was in the 100th place of a 150 sized list .. you might end up with 99 passes ... CRAZY STUFF .. that is simply unnecessary. Now this was never the case with stacks .... I was confused why people call linked lists better than stacks !! ... i could never assume that ... but friends said that ... but what i thought was true ... ( i know it now !! )
Fr. Jose says whatever you are taught cannot be comprehended at the instant ... it takes time .. only long after you pass on you might just say "OH YEAH .. i got it."
0 comments:
Post a Comment