diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..1b2d693
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..2801bef
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Detective.java b/Detective.java
index 5707416..aacfd83 100644
--- a/Detective.java
+++ b/Detective.java
@@ -16,7 +16,7 @@ public static void main(String[] args) {
// Poirot
ArrayList poirotsToDos = new ArrayList();
-
+
poirotsToDos.add("visit the crime scene");
poirotsToDos.add("interview suspects");
poirotsToDos.add("let the little grey cells do their work");
@@ -25,11 +25,20 @@ public static void main(String[] args) {
poirotsToDos.add("reveal the truth of the crime");
// Print the size of each ArrayList below:
-
+ System.out.println("sherlocksToDo's size: "+ sherlocksToDos.size());
+ System.out.println("poirotsToDo's size: "+ poirotsToDos.size());
// Print the name of the detective with the larger to-do list:
-
+ if(poirotsToDos.size()sherlocksToDos.size()){
+ System.out.println("Poirot has more things to do");
+ }
+ else if(poirotsToDos.size()==sherlocksToDos.size()){
+ System.out.println("both detectives have same amount of things to do");
+ }
+
}
}
diff --git a/HashCollisionChecker.java b/HashCollisionChecker.java
index 80631a7..8fa927d 100644
--- a/HashCollisionChecker.java
+++ b/HashCollisionChecker.java
@@ -3,12 +3,22 @@
public class HashCollisionChecker {
public static int countOfUniqueHashCodes(HashSet set) {
// TODO: Implement
- return 0;
+ HashSet hashcode = new HashSet<>();
+ for(T i : set){
+ hashcode.add(i.hashCode());
+
+ }
+ return hashcode.size();
}
public static int countOfUniqueHashCodes(HashMap map) {
// TODO: Implement
- return 0;
+ HashSet hashcode = new HashSet<>();
+ for(K i : map.keySet()){
+ hashcode.add(i.hashCode());
+
+ }
+ return hashcode.size();
}
public static void main(String[] args) {
diff --git a/Last-Assignment.iml b/Last-Assignment.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/Last-Assignment.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SafEMashin.java b/SafEMashin.java
new file mode 100644
index 0000000..52cdaa7
--- /dev/null
+++ b/SafEMashin.java
@@ -0,0 +1,40 @@
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Iterator;
+public class SafEMashin{
+ public static void main(String[] args){
+ Queue