西西河

主题:求教大家一个算法问题 -- looklook

共:💬24 🌺10 新:
全看分页树展 · 主题 跟帖
家园 There are always two solutions for the classic issue.

As for contains() implementation, check out Sun's JDK implementation. I believe it's O(1) as the Javadoc declared.

Well, there are always two solutions for the classic issue. One is the solution you mentioned above, and the other is the one I gave.

bigbug

全看分页树展 · 主题 跟帖


有趣有益,互惠互利;开阔视野,博采众长。
虚拟的网络,真实的人。天南地北客,相逢皆朋友

Copyright © cchere 西西河