0 0 votes Can there be “Stack Overflow” in Linked list Implementation of stack? If Yes, how? Data Structures stack data-structures linked-list + – Abhrajyoti00 1.2k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply DebRC commented Oct 29, 2022 reply Follow flag Theoretically, no. Practically, yes. Every program is assigned a heap memory, where it can dynamically allocate memory if needed. Once it gets full (Heap Overflow), your ADT Stack won’t be able to create more nodes, thus creating Stack Overflow. 3 3 replyShare Abhrajyoti00 commented Oct 30, 2022 reply Follow flag @DebSujit So no Stack Overflow right? That’s Heap Overflow. Or is it Stack Overflow because of Heap Overflow? But it sounds technically incorrect. 0 0 replyShare DebRC commented Oct 30, 2022 reply Follow flag Stack Overflow because of Heap Overflow. Anyway, if this happens it equates to bad programming, as for any stack implementation there should be a upper bound, which checks and minimizes wastage of memory. 1 1 replyShare Please log in or register to add a comment.
Best answer 4 4 votes Stack overflows are not expected to occur when a stack is implemented with a linked list. Although, it could occur if we ran out of memory in our machine. arkaprava_gupta answered Nov 5, 2022 • selected Nov 13, 2022 by Abhrajyoti00 arkaprava_gupta comment Share Follow 0 reply Please log in or register to add a comment.