Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with both parts (a) and (b) of this question: . . The Dynamic Set is an abstract data type (ADT) that can
I need help with both parts (a) and (b) of this question:
. . The Dynamic Set is an abstract data type (ADT) that can store distinct elements, without any particular order. There are five main operations in the ADT: ADD(S,x): add element x to S, if it is not present already REMOVE(S,x): remove element x from S, if it is present IS-ELEMENT(S,x): check whether element x is in set S SET-EMPTY(S): check whether set S has no elements SET-SIZE(S): return the number of elements of set S Additionally, the Dynamic Set ADT defines the following set-theoretical operations: UNION(S,T): return the union of sets S and T INTERSECTION (S,T): return the intersection of sets S and T DIFFERENCE(S,T): returns the difference of sets S and T SUBSET(S,T): check whether set S is a subset of set T Implement in Java the Dynamic Set ADT defined above using a) a doubly linked list and [9] b) a binary search tree. 191 Observe that the ADT implementation should use Java Generics (see Lab 3) and operations should be in the form s.add(x), s.remove (x), etc. Explain in the report your implementation, noting the running time (using big Oh notation) of each operation in both implementations. Note you can use a self-balancing binary tree but no extra marks will be awarded. Also, you are not allowed to rely on Java library classes in your implementationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started