In the separate chaining and open addressing hashing schemes, the running time
for doing a search is expected to be O(1), but it can be as bad as O(n) in the worst
case (albeit with very low probability). In the case of separate chaining, the running
time of the put(k, v) method runs in O(1) time in the worst case, however. In most
applications, we would expect to perform more searches than insertions, so it would
be nice to have a collision-handling scheme that can guarantee that searches run in
O(1) time in the worst case, while allowing for insertions to run in O(1) time as
an expected bound. Interestingly, the cuckoo hashing scheme we describe in this
section achieves this performance goal while still being an open addressing scheme,
like linear probing.
ในส่วนการโยงและเปิดการ hashing โครงร่าง , วิ่งเวลา
เพื่อทำการค้นหาคาดว่าจะเป็น O ( 1 ) แต่มันสามารถเป็นเลวเป็น O ( n ) ในกรณีแย่ที่สุด
( แม้จะมีความน่าจะเป็นต่ำมาก ) ในกรณีที่แยกผูกมัด , วิ่ง
เวลาใส่ ( K ( , 5 ) วิธีการทำงานใน O ( 1 ) เวลาในกรณีเลวร้ายที่สุด อย่างไรก็ตาม ในโปรแกรมส่วนใหญ่
,เราคาดหวังที่จะดำเนินการค้นหามากกว่าครั้ง ดังนั้นมันจะ
จะดีมีชนจัดการโครงการที่สามารถรับประกันได้ว่า การใช้
o ( 1 ) เวลา ในกรณีที่เลวร้ายที่สุด ในขณะที่การอนุญาตให้แทรกเข้ามาวิ่งในเวลาเป็น O ( 1 )
คาดว่าจะได้ผูกพัน น่าสนใจ , นกกาเหว่า hashing โครงการเราอธิบายในนี้
ส่วนที่ใช้แสดงเป้าหมายในขณะที่ยังคงถูกเปิดอยู่โครงการ ,
ชอบเส้นสำรวจ
การแปล กรุณารอสักครู่..
