0 votes 0 votes Can there be “Stack Overflow” in Linked list Implementation of stack? If Yes, how? DS stack data-structures linked-list + – Abhrajyoti00 asked Oct 29, 2022 Abhrajyoti00 744 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply DebRC commented Oct 29, 2022 reply Follow Share 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. 2 votes 2 votes Abhrajyoti00 commented Oct 30, 2022 reply Follow Share @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 votes 0 votes DebRC commented Oct 30, 2022 reply Follow Share 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 votes 1 votes Please log in or register to add a comment.
Best answer 4 votes 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 See all 0 reply Please log in or register to add a comment.