SlideShare a Scribd company logo
1 of 2
public class Bitset implements Set{
private boolean set[];
public Bitset(){
set = new boolean[max];
}
public void add(int num){
set[num]=true;
}
public void display(){
System.out.print("{");
for(int i=0;i<max;i++){
if(set[i]==true)
System.out.print(" " + i);
}
System.out.println("}");
}
public Set union(Set s){
Set s1 = new Bitset();
for(int i=0;i<max;i++){
((Bitset)s1).set[i]=this.set[i]||((Bitset)s).set[i];
}
return s1;
}
public Set intersection(Set s);
public Set difference(Set s);
public boolean subset(Set s);
public boolean disjoint(Set s);
public int cardinality();
public static void main(String[] args){
Set bitset = new Bitset();
bitset.add(5);
bitset.display();
}
}
public class Bitset implements Set{     private boolean set---     pub.docx

More Related Content

More from LukeQVdGrantg

Properties that Define Life ( 10 points) Matching- Please write the le.docx
Properties that Define Life ( 10 points) Matching- Please write the le.docxProperties that Define Life ( 10 points) Matching- Please write the le.docx
Properties that Define Life ( 10 points) Matching- Please write the le.docxLukeQVdGrantg
 
Prompt 3- 70- of the light aircraft that disappear while in flight in.docx
Prompt 3- 70- of the light aircraft that disappear while in flight in.docxPrompt 3- 70- of the light aircraft that disappear while in flight in.docx
Prompt 3- 70- of the light aircraft that disappear while in flight in.docxLukeQVdGrantg
 
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docxPrompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docxLukeQVdGrantg
 
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docxProkaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docxLukeQVdGrantg
 
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docxProlessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docxLukeQVdGrantg
 
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docxPROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docxLukeQVdGrantg
 
Project Part 1- Analysis of the opportunities and risks of a company i.docx
Project Part 1- Analysis of the opportunities and risks of a company i.docxProject Part 1- Analysis of the opportunities and risks of a company i.docx
Project Part 1- Analysis of the opportunities and risks of a company i.docxLukeQVdGrantg
 
Project Objectives- To write a program that implements the following A.docx
Project Objectives- To write a program that implements the following A.docxProject Objectives- To write a program that implements the following A.docx
Project Objectives- To write a program that implements the following A.docxLukeQVdGrantg
 
Project gamesmanship in organizations performs what purpose- Creates c.docx
Project gamesmanship in organizations performs what purpose- Creates c.docxProject gamesmanship in organizations performs what purpose- Creates c.docx
Project gamesmanship in organizations performs what purpose- Creates c.docxLukeQVdGrantg
 
Project managers should turn customer needs into requirements- The sum.docx
Project managers should turn customer needs into requirements- The sum.docxProject managers should turn customer needs into requirements- The sum.docx
Project managers should turn customer needs into requirements- The sum.docxLukeQVdGrantg
 
Project managers use this conflict resolution technique most often- A-.docx
Project managers use this conflict resolution technique most often- A-.docxProject managers use this conflict resolution technique most often- A-.docx
Project managers use this conflict resolution technique most often- A-.docxLukeQVdGrantg
 
Project Controlling involves ensuring that performance does not deviat.docx
Project Controlling involves ensuring that performance does not deviat.docxProject Controlling involves ensuring that performance does not deviat.docx
Project Controlling involves ensuring that performance does not deviat.docxLukeQVdGrantg
 
Project 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docx
Project 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docxProject 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docx
Project 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docxLukeQVdGrantg
 
Programming Assignment- Building a functional program Here are my err.docx
Programming Assignment- Building a functional program  Here are my err.docxProgramming Assignment- Building a functional program  Here are my err.docx
Programming Assignment- Building a functional program Here are my err.docxLukeQVdGrantg
 
Programming Assignment Sending a file to another computer You may use.docx
Programming Assignment Sending a file to another computer You may use.docxProgramming Assignment Sending a file to another computer You may use.docx
Programming Assignment Sending a file to another computer You may use.docxLukeQVdGrantg
 
Q3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docx
Q3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docxQ3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docx
Q3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docxLukeQVdGrantg
 
Q3- Another adaptive routing scheme is known as backward learning- As.docx
Q3- Another adaptive routing scheme is known as backward learning- As.docxQ3- Another adaptive routing scheme is known as backward learning- As.docx
Q3- Another adaptive routing scheme is known as backward learning- As.docxLukeQVdGrantg
 
Q3)- Strategic managers often use teams to analyze prospective projec.docx
Q3)-  Strategic managers often use teams to analyze prospective projec.docxQ3)-  Strategic managers often use teams to analyze prospective projec.docx
Q3)- Strategic managers often use teams to analyze prospective projec.docxLukeQVdGrantg
 
Q3 Python Add the function to a PyDev module named functions- py- Test.docx
Q3 Python Add the function to a PyDev module named functions- py- Test.docxQ3 Python Add the function to a PyDev module named functions- py- Test.docx
Q3 Python Add the function to a PyDev module named functions- py- Test.docxLukeQVdGrantg
 
Q3 what is the time complexity of the following operations on a std--l.docx
Q3 what is the time complexity of the following operations on a std--l.docxQ3 what is the time complexity of the following operations on a std--l.docx
Q3 what is the time complexity of the following operations on a std--l.docxLukeQVdGrantg
 

More from LukeQVdGrantg (20)

Properties that Define Life ( 10 points) Matching- Please write the le.docx
Properties that Define Life ( 10 points) Matching- Please write the le.docxProperties that Define Life ( 10 points) Matching- Please write the le.docx
Properties that Define Life ( 10 points) Matching- Please write the le.docx
 
Prompt 3- 70- of the light aircraft that disappear while in flight in.docx
Prompt 3- 70- of the light aircraft that disappear while in flight in.docxPrompt 3- 70- of the light aircraft that disappear while in flight in.docx
Prompt 3- 70- of the light aircraft that disappear while in flight in.docx
 
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docxPrompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
 
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docxProkaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
 
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docxProlessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
 
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docxPROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
 
Project Part 1- Analysis of the opportunities and risks of a company i.docx
Project Part 1- Analysis of the opportunities and risks of a company i.docxProject Part 1- Analysis of the opportunities and risks of a company i.docx
Project Part 1- Analysis of the opportunities and risks of a company i.docx
 
Project Objectives- To write a program that implements the following A.docx
Project Objectives- To write a program that implements the following A.docxProject Objectives- To write a program that implements the following A.docx
Project Objectives- To write a program that implements the following A.docx
 
Project gamesmanship in organizations performs what purpose- Creates c.docx
Project gamesmanship in organizations performs what purpose- Creates c.docxProject gamesmanship in organizations performs what purpose- Creates c.docx
Project gamesmanship in organizations performs what purpose- Creates c.docx
 
Project managers should turn customer needs into requirements- The sum.docx
Project managers should turn customer needs into requirements- The sum.docxProject managers should turn customer needs into requirements- The sum.docx
Project managers should turn customer needs into requirements- The sum.docx
 
Project managers use this conflict resolution technique most often- A-.docx
Project managers use this conflict resolution technique most often- A-.docxProject managers use this conflict resolution technique most often- A-.docx
Project managers use this conflict resolution technique most often- A-.docx
 
Project Controlling involves ensuring that performance does not deviat.docx
Project Controlling involves ensuring that performance does not deviat.docxProject Controlling involves ensuring that performance does not deviat.docx
Project Controlling involves ensuring that performance does not deviat.docx
 
Project 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docx
Project 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docxProject 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docx
Project 1 - Bioterrorism Simulation Abstract- We want to simulate an i.docx
 
Programming Assignment- Building a functional program Here are my err.docx
Programming Assignment- Building a functional program  Here are my err.docxProgramming Assignment- Building a functional program  Here are my err.docx
Programming Assignment- Building a functional program Here are my err.docx
 
Programming Assignment Sending a file to another computer You may use.docx
Programming Assignment Sending a file to another computer You may use.docxProgramming Assignment Sending a file to another computer You may use.docx
Programming Assignment Sending a file to another computer You may use.docx
 
Q3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docx
Q3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docxQ3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docx
Q3 Statistical Method - ANOVA 3- Four catalysts that may effect the co.docx
 
Q3- Another adaptive routing scheme is known as backward learning- As.docx
Q3- Another adaptive routing scheme is known as backward learning- As.docxQ3- Another adaptive routing scheme is known as backward learning- As.docx
Q3- Another adaptive routing scheme is known as backward learning- As.docx
 
Q3)- Strategic managers often use teams to analyze prospective projec.docx
Q3)-  Strategic managers often use teams to analyze prospective projec.docxQ3)-  Strategic managers often use teams to analyze prospective projec.docx
Q3)- Strategic managers often use teams to analyze prospective projec.docx
 
Q3 Python Add the function to a PyDev module named functions- py- Test.docx
Q3 Python Add the function to a PyDev module named functions- py- Test.docxQ3 Python Add the function to a PyDev module named functions- py- Test.docx
Q3 Python Add the function to a PyDev module named functions- py- Test.docx
 
Q3 what is the time complexity of the following operations on a std--l.docx
Q3 what is the time complexity of the following operations on a std--l.docxQ3 what is the time complexity of the following operations on a std--l.docx
Q3 what is the time complexity of the following operations on a std--l.docx
 

Recently uploaded

How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsPallavi Parmar
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfElizabeth Walsh
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfKartik Tiwari
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 

Recently uploaded (20)

How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

public class Bitset implements Set{ private boolean set--- pub.docx

  • 1. public class Bitset implements Set{ private boolean set[]; public Bitset(){ set = new boolean[max]; } public void add(int num){ set[num]=true; } public void display(){ System.out.print("{"); for(int i=0;i<max;i++){ if(set[i]==true) System.out.print(" " + i); } System.out.println("}"); } public Set union(Set s){ Set s1 = new Bitset(); for(int i=0;i<max;i++){ ((Bitset)s1).set[i]=this.set[i]||((Bitset)s).set[i]; } return s1; } public Set intersection(Set s); public Set difference(Set s); public boolean subset(Set s); public boolean disjoint(Set s); public int cardinality(); public static void main(String[] args){ Set bitset = new Bitset(); bitset.add(5); bitset.display(); } }