@@ -572,26 +572,25 @@ I'm using Github's special markdown flavor, including tasks lists to check progr
572572 - [ ] [ 使用 Stacks 後進先出 (LIFO) (影片)] ( https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-stacks-last-first-out/149042/177120-4.html )
573573 - [ ] 不包含實作,使用陣列來實作太繁瑣了。
574574
575- - ### Queue
576- - [ ] [ Using Queues First-In First-Out(video )] ( https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-queues-first-first-out/149042/177122-4.html )
577- - [ ] [ Queue (video )] ( https://www.coursera.org/learn/data-structures/lecture/EShpq/queue )
578- - [ ] [ Circular buffer/FIFO ] ( https://en.wikipedia.org/wiki/Circular_buffer )
579- - [ ] [ Priority Queues (video )] ( https://www.lynda.com/Developer-Programming-Foundations-tutorials/Priority-queues-deques/149042/177123-4.html )
580- - [ ] Implement using linked-list, with tail pointer:
581- - enqueue(value) - adds value at position at tail
582- - dequeue() - returns value and removes least recently added element (front)
575+ - ### 佇列 ( Queue)
576+ - [ ] [ 使用佇列,先進先出 (影片 )] ( https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-queues-first-first-out/149042/177122-4.html )
577+ - [ ] [ 佇列 (影片 )] ( https://www.coursera.org/learn/data-structures/lecture/EShpq/queue )
578+ - [ ] [ 環形緩衝區/先進先出 ] ( https://en.wikipedia.org/wiki/Circular_buffer )
579+ - [ ] [ 優先權佇列 (影片 )] ( https://www.lynda.com/Developer-Programming-Foundations-tutorials/Priority-queues-deques/149042/177123-4.html )
580+ - [ ] 使用鏈結串列來實作,並包含 tail pointer:
581+ - enqueue(value) - 在佇列的尾端插入元素
582+ - dequeue() - 回傳佇列最前端的元素值,並將其移除
583583 - empty()
584- - [ ] Implement using fixed-sized array:
585- - enqueue(value) - adds item at end of available storage
586- - dequeue() - returns value and removes least recently added element
584+ - [ ] 使用固定大小的陣列來實作:
585+ - enqueue(value) - 在可用的儲存空間中加入元素到最後的位置
586+ - dequeue() - 回傳佇列最前端的元素值,並將其移除
587587 - empty()
588588 - full()
589- - [ ] Cost:
590- - a bad implementation using linked list where you enqueue at head and dequeue at tail would be O(n)
591- because you'd need the next to last element, causing a full traversal each dequeue
592- - enqueue: O(1) (amortized, linked list and array [ probing] )
593- - dequeue: O(1) (linked list and array)
594- - empty: O(1) (linked list and array)
589+ - [ ] 成本:
590+ - 當你使用鏈結串列進行實作時,如果實作的不好,當你使用 enqueue 或 dequeue 來取出或放入元素時可能會需要 O(n),因為你可能會需要遍歷整個佇列來取得倒數第二個元素。
591+ - enqueue: O(1) (amortized、鏈結串列和陣列 [ 探察] )
592+ - dequeue: O(1) (鏈結串列和陣列)
593+ - empty: O(1) (鏈結串列和陣列)
595594
596595- ### Hash table
597596 - [ ] Videos:
0 commit comments