insert, delete, max in O(1)

后端 未结 8 1168
北海茫月
北海茫月 2020-11-29 17:42

Can someone tell me which data structure supports insert/delete/maximum operation in O(1)?

8条回答
  •  感动是毒
    2020-11-29 18:10

    A hash table might support insert/delete in O(1), no clue about maximum though. You'd probably need to keep track of it yourself somehow.

提交回复
热议问题