This is the Java programming language.  Please respond as soon as possible.  To represent set partitions in this assignment, you will utilise a tree-based data structure. A collection of trees will be used to depict a set division. Each tree will represent a subset, with one node representing each subset element.  1.1  Getting Started - Create the SetPartition class. It should contain the following features: an inner class called Node, as mentioned before; an array of Node objects, one for each set element; and a function Object() { [native code] } called SetPartition (int numElements). The function Object() { [native code] } should set up the array and Nodes to reflect the partition of the set 0-1, numElements 1, where the subsets are 0-1, numElements 1, and numElements 1.  1.2 Finding roots - In your class, create a public int getRoot (int x) function that returns the value at the root of the tree containing x. (Note that the result of getRoot() won't be very interesting until you write merge(), which is described below, because each value will be in a subset containing only itself.)  1.3 Do they belong to the same subset? - Add a public boolean inSameSubset (int x, int y) function that checks if x and y will be in the same division subset.  Code evaluation - Create a main method that accomplishes the following tasks. 1. Creates a SetPartition with 1000 components, then calls merge(0,1), merge(1,2),..., merge(998,999) to get the tree's maximum node depth. 2. Creates a SetPartition with 1000 members, calls merge(998,999), merge(997,998), etc., and reports the tree's maximum node depth. 3. Generates 1000 SetPartitions with 1000 items each, performs 750 random merges on each, and provides the average maximum node depth of these trees. (The answer should be in the range of 61–63.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This is the Java programming language. 
Please respond as soon as possible. 
To represent set partitions in this assignment, you will utilise a tree-based data structure. A collection of trees will be used to depict a set division. Each tree will represent a subset, with one node representing each subset element. 
1.1 
Getting Started - Create the SetPartition class. It should contain the following features: an inner class called Node, as mentioned before; an array of Node objects, one for each set element; and a function Object() { [native code] } called SetPartition (int numElements). The function Object() { [native code] } should set up the array and Nodes to reflect the partition of the set 0-1, numElements 1, where the subsets are 0-1, numElements 1, and numElements 1. 
1.2 Finding roots - In your class, create a public int getRoot (int x) function that returns the value at the root of the tree containing x. (Note that the result of getRoot() won't be very interesting until you write merge(), which is described below, because each value will be in a subset containing only itself.) 
1.3 Do they belong to the same subset? - Add a public boolean inSameSubset (int x, int y) function that checks if x and y will be in the same division subset. 
Code evaluation - Create a main method that accomplishes the following tasks. 1. Creates a SetPartition with 1000 components, then calls merge(0,1), merge(1,2),..., merge(998,999) to get the tree's maximum node depth. 2. Creates a SetPartition with 1000 members, calls merge(998,999), merge(997,998), etc., and reports the tree's maximum node depth. 3. Generates 1000 SetPartitions with 1000 items each, performs 750 random merges on each, and provides the average maximum node depth of these trees. (The answer should be in the range of 61–63.

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Randomized Select Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education