11 Nisan 2020 Cumartesi

Basit Stack Veri Yapısı


Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/529/week-2/3292/
 

>> Solution 1 :Basit linked list, her node'da minimumu tut

O(1) time complexity, O(n) space complexity

Hiç yorum yok: