資料結構›Ch4 鏈結串列
第 2 題/共 22 題
◀ DS 2/22
2. Circular Linked List、BST、去重複
#DS-04-002中Circular Linked ListBST去重複

a. Please write a pseudocode function that takes a doubly circular linked list as input, and removes all the duplicate elements. For example, if the content of the doubly circular linked list is '1, 3, 3, 2, 4, 2', it becomes '1, 3, 2, 4' after your function is executed. No return values are expected. You have two options to store a set of unique elements: binary search tree and balanced search tree. You can directly use either of them, without explaining how they are implemented. Note: A node in a doubly circular linked list has two pointers, named 'next' and 'prev', respectively, where the 'next' pointer is used to find the next node and the 'prev' pointer is used to find the previous one.

b. Please analyze the complexity of your function when binary search tree is used to store the set of unique elements.

c. Please analyze the complexity of your function when balanced search tree is used to store the set of unique elements.

📄 台大113
跳轉到第題
▤完整推導請見《WH 資工筆記 · 資料結構》Ch4 鏈結串列
本章題號 · 1–20 / 22