Commit bd03036c authored by MoutazDebbaneh's avatar MoutazDebbaneh

Add upper bound for rand. Edit README.md

parent b508e72a
...@@ -4,13 +4,10 @@ ...@@ -4,13 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="39d1573e-bc8d-4759-8e1b-31b85df143ea" name="Changes" comment="Initial commit"> <list default="true" id="39d1573e-bc8d-4759-8e1b-31b85df143ea" name="Changes" comment="Add first question solution">
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/org/example/ArrayOccurrencesCount.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/test/java/ArrayOccurrencesCountTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/org/example/Main.java" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/src/test/java/ArrayOccurrencesCountTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/ArrayOccurrencesCountTest.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -124,7 +121,14 @@ ...@@ -124,7 +121,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1679400277116</updated> <updated>1679400277116</updated>
</task> </task>
<option name="localTasksCounter" value="2" /> <task id="LOCAL-00002" summary="Add first question solution">
<created>1679408135254</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1679408135254</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
...@@ -140,6 +144,7 @@ ...@@ -140,6 +144,7 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="Initial commit" /> <MESSAGE value="Initial commit" />
<option name="LAST_COMMIT_MESSAGE" value="Initial commit" /> <MESSAGE value="Add first question solution" />
<option name="LAST_COMMIT_MESSAGE" value="Add first question solution" />
</component> </component>
</project> </project>
\ No newline at end of file
# Parallel Programming HW1 # Parallel Programming HW1
> Important Note: Please make sure to change JVM memory heap settings to enable making an array of a billion elements > Important Note: Please make sure to change JVM memory heap settings to enable making an array of a billion elements
### Notes regarding some questions:
<br />
#### 1. Question One:
- Function intStream() was used for testing instead of randomArray() because its answer is expected, and therefore the comparison is easier
\ No newline at end of file
...@@ -10,7 +10,7 @@ public class ArrayOccurrencesCountTest extends TestCase { ...@@ -10,7 +10,7 @@ public class ArrayOccurrencesCountTest extends TestCase {
Random rand = new Random(); Random rand = new Random();
int[] arr = new int[size]; int[] arr = new int[size];
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
arr[i] = rand.nextInt(size); arr[i] = rand.nextInt(100000);
} }
return arr; return arr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment