Data Structure代写:CSC 330: Advanced Data Structures

一个数据结构的作业代写。改一个linked list的实现,回答一些相关问题即可。

Question 1 (100 points): Modify the provided linked list code to store any generic type data (Use type parameters). You should add other required methods provided in page 252. Use the Collection interface (provided in page 239), List interface (provided in page 248), Iterator interface (page 241), ListIterator interface (provided in page 249). Test your implementation by creating a Circle class and store Circle objects in the list. Use your iterator to iterate over the linked list and print the content.

Question 2: What is the use of an iterator?

Question 3: What are the different implementations of the Set interface?

What are the differences between HashSet, LinkedHashSet, and TreeSet?

Question 4: What are the different implementations of the Map interface?

What are the differences between HashMap, LinkedHashMap, and TreeMap? When would you choose one over another?

Question 5: Imagine that are reading a chapter from a book and you want to compute the occurrence frequencies for all words in the chapter. What data structure would use in this computation? Justify your choice.

Question 6: What is the time complexity of the insert, remove, and search operations on the following data structures?

  • LinkedList
  • ArrayList
  • HashSet
  • LinkedHashSet
  • TreeSet
  • HashMap
  • TreeMap
kamisama wechat
KamiSama