Skip to main content
14 events
when toggle format what by license comment
S Dec 23, 2024 at 16:52 history bounty ended Irdis
S Dec 23, 2024 at 16:52 history notice removed Irdis
Dec 23, 2024 at 13:43 vote accept Irdis
Dec 23, 2024 at 6:29 comment added D.W. I'm asking a clarification question: should we add them back in, or not? I would like to see the question state the answer explicitly and specify what exactly the insert() operation is supposed to do. I can't tell, and before I answer, I want to be sure I understand what is the question.
Dec 22, 2024 at 22:05 comment added D.W. Is insert(x) supposed to add x to the stack and keep all of the existing elements? Or is it supposed to remove all elements greater than x, and not add them back in?
Dec 22, 2024 at 19:57 answer added Kelly Bundy timeline score: 0
S Dec 22, 2024 at 16:39 history bounty started Irdis
S Dec 22, 2024 at 16:39 history notice added Irdis Draw attention
Dec 22, 2024 at 15:29 comment added Irdis @RinkeshP Sure conventional stack supports only push and pop, I'm interested in case when we represent stack as array and size as int. For example, we can empty array in constant time, this.size = 0. I also consider case when we don't have to resize in case it too short for simplicity
Dec 22, 2024 at 12:16 comment added Rinkesh P "Does it change complexity?" Depends on the implementation. A stack by convention supports the "push" and "pop" operations for insertion and deletion respectively, at a single location "top of stack".
Dec 21, 2024 at 22:55 history edited Irdis CC BY-SA 4.0
added 2 characters in body
Dec 21, 2024 at 20:14 history edited Irdis CC BY-SA 4.0
added 264 characters in body
S Dec 20, 2024 at 15:20 review First questions
Dec 23, 2024 at 13:46
S Dec 20, 2024 at 15:20 history asked Irdis CC BY-SA 4.0