thulasi il y a 6 ans
Parent
révision
e5f58ab730
5 fichiers modifiés avec 235 ajouts et 84 suppressions
  1. 73
    67
      .idea/workspace.xml
  2. 1
    1
      arraz/arraz.iml
  3. 12
    0
      arraz/pom.xml
  4. 51
    16
      arraz/src/main/java/Arraz.java
  5. 98
    0
      arraz/src/test/java/ArrazTest.java

+ 73
- 67
.idea/workspace.xml Voir le fichier

2
 <project version="4">
2
 <project version="4">
3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="3455511b-a100-4bbd-b07c-68f009bc8dbc" name="Default" comment="">
4
     <list default="true" id="3455511b-a100-4bbd-b07c-68f009bc8dbc" name="Default" comment="">
5
-      <change afterPath="$PROJECT_DIR$/arraz/src/main/java/MaxMin.java" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
9
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/arraz/arraz.iml" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/arraz.iml" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/arraz/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/pom.xml" afterDir="false" />
10
       <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
8
       <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
11
       <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
9
       <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
12
     </list>
10
     </list>
21
     <session id="458231039">
19
     <session id="458231039">
22
       <usages-collector id="statistics.lifecycle.project">
20
       <usages-collector id="statistics.lifecycle.project">
23
         <counts>
21
         <counts>
24
-          <entry key="project.closed" value="1" />
22
+          <entry key="project.closed" value="2" />
23
+          <entry key="project.open.time.13" value="1" />
25
           <entry key="project.open.time.15" value="1" />
24
           <entry key="project.open.time.15" value="1" />
26
           <entry key="project.open.time.8" value="1" />
25
           <entry key="project.open.time.8" value="1" />
27
-          <entry key="project.opened" value="2" />
26
+          <entry key="project.opened" value="3" />
28
         </counts>
27
         </counts>
29
       </usages-collector>
28
       </usages-collector>
30
       <usages-collector id="statistics.file.extensions.edit">
29
       <usages-collector id="statistics.file.extensions.edit">
31
         <counts>
30
         <counts>
32
-          <entry key="java" value="3363" />
31
+          <entry key="java" value="4494" />
33
         </counts>
32
         </counts>
34
       </usages-collector>
33
       </usages-collector>
35
       <usages-collector id="statistics.file.types.edit">
34
       <usages-collector id="statistics.file.types.edit">
36
         <counts>
35
         <counts>
37
-          <entry key="JAVA" value="3363" />
36
+          <entry key="JAVA" value="4494" />
38
         </counts>
37
         </counts>
39
       </usages-collector>
38
       </usages-collector>
40
       <usages-collector id="statistics.file.extensions.open">
39
       <usages-collector id="statistics.file.extensions.open">
41
         <counts>
40
         <counts>
42
-          <entry key="java" value="2" />
41
+          <entry key="java" value="3" />
43
         </counts>
42
         </counts>
44
       </usages-collector>
43
       </usages-collector>
45
       <usages-collector id="statistics.file.types.open">
44
       <usages-collector id="statistics.file.types.open">
46
         <counts>
45
         <counts>
47
-          <entry key="JAVA" value="2" />
46
+          <entry key="JAVA" value="3" />
48
         </counts>
47
         </counts>
49
       </usages-collector>
48
       </usages-collector>
50
     </session>
49
     </session>
59
       <file pinned="false" current-in-tab="true">
58
       <file pinned="false" current-in-tab="true">
60
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
59
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
61
           <provider selected="true" editor-type-id="text-editor">
60
           <provider selected="true" editor-type-id="text-editor">
62
-            <state relative-caret-position="97">
63
-              <caret line="112" column="20" lean-forward="true" selection-start-line="112" selection-start-column="20" selection-end-line="112" selection-end-column="20" />
61
+            <state relative-caret-position="231">
62
+              <caret line="189" column="4" selection-start-line="189" selection-start-column="4" selection-end-line="189" selection-end-column="4" />
64
               <folding>
63
               <folding>
65
                 <element signature="imports" expanded="true" />
64
                 <element signature="imports" expanded="true" />
66
-                <element signature="e#351#352#0" expanded="true" />
67
-                <element signature="e#385#386#0" expanded="true" />
68
-                <element signature="e#456#457#0" expanded="true" />
69
-                <element signature="e#497#498#0" expanded="true" />
70
-                <element signature="e#1551#1560#0" expanded="true" />
65
+                <element signature="e#3653#3654#0" expanded="true" />
66
+                <element signature="e#3679#3680#0" expanded="true" />
71
               </folding>
67
               </folding>
72
             </state>
68
             </state>
73
           </provider>
69
           </provider>
76
       <file pinned="false" current-in-tab="false">
72
       <file pinned="false" current-in-tab="false">
77
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
73
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
78
           <provider selected="true" editor-type-id="text-editor">
74
           <provider selected="true" editor-type-id="text-editor">
79
-            <state relative-caret-position="181">
80
-              <caret line="282" column="25" selection-start-line="282" selection-start-column="25" selection-end-line="282" selection-end-column="25" />
75
+            <state relative-caret-position="292">
76
+              <caret line="373" column="45" selection-start-line="373" selection-start-column="45" selection-end-line="373" selection-end-column="45" />
81
               <folding>
77
               <folding>
82
                 <element signature="imports" expanded="true" />
78
                 <element signature="imports" expanded="true" />
83
               </folding>
79
               </folding>
141
       </MavenImportingSettings>
137
       </MavenImportingSettings>
142
     </option>
138
     </option>
143
   </component>
139
   </component>
144
-  <component name="ProjectFrameBounds" extendedState="1">
140
+  <component name="ProjectFrameBounds">
145
     <option name="y" value="23" />
141
     <option name="y" value="23" />
146
     <option name="width" value="1280" />
142
     <option name="width" value="1280" />
147
     <option name="height" value="709" />
143
     <option name="height" value="709" />
285
     <property name="GO_FMT" value="false" />
281
     <property name="GO_FMT" value="false" />
286
     <property name="WebServerToolWindowFactoryState" value="false" />
282
     <property name="WebServerToolWindowFactoryState" value="false" />
287
     <property name="aspect.path.notification.shown" value="true" />
283
     <property name="aspect.path.notification.shown" value="true" />
288
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544101913454" />
284
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544194085762" />
289
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
285
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
290
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
286
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
291
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
287
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
318
       </list>
314
       </list>
319
     </option>
315
     </option>
320
   </component>
316
   </component>
321
-  <component name="RunManager" selected="JUnit.ArrazTest">
317
+  <component name="RunManager" selected="JUnit.ArrazTest.test1RemoveDupesFromArray">
322
     <configuration default="true" type="Applet" factoryName="Applet">
318
     <configuration default="true" type="Applet" factoryName="Applet">
323
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
319
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
324
       <method v="2">
320
       <method v="2">
351
         <option name="Make" enabled="true" />
347
         <option name="Make" enabled="true" />
352
       </method>
348
       </method>
353
     </configuration>
349
     </configuration>
350
+    <configuration name="ArrazTest.test1RemoveDupesFromArray" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
351
+      <module name="arraz" />
352
+      <option name="PACKAGE_NAME" value="" />
353
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
354
+      <option name="METHOD_NAME" value="test1RemoveDupesFromArray" />
355
+      <option name="TEST_OBJECT" value="method" />
356
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
357
+      <method v="2">
358
+        <option name="Make" enabled="true" />
359
+      </method>
360
+    </configuration>
354
     <configuration name="ArrazTest.test2CopyArrayByInterator" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
361
     <configuration name="ArrazTest.test2CopyArrayByInterator" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
355
       <module name="arraz" />
362
       <module name="arraz" />
356
       <option name="PACKAGE_NAME" value="" />
363
       <option name="PACKAGE_NAME" value="" />
389
       <item itemvalue="JUnit.ArrazTest" />
396
       <item itemvalue="JUnit.ArrazTest" />
390
       <item itemvalue="JUnit.ArrazTest.test1CopyArrayByInterator" />
397
       <item itemvalue="JUnit.ArrazTest.test1CopyArrayByInterator" />
391
       <item itemvalue="JUnit.ArrazTest.test2CopyArrayByInterator" />
398
       <item itemvalue="JUnit.ArrazTest.test2CopyArrayByInterator" />
399
+      <item itemvalue="JUnit.ArrazTest.test1RemoveDupesFromArray" />
392
     </list>
400
     </list>
393
     <recent_temporary>
401
     <recent_temporary>
394
       <list>
402
       <list>
395
         <item itemvalue="JUnit.ArrazTest" />
403
         <item itemvalue="JUnit.ArrazTest" />
404
+        <item itemvalue="JUnit.ArrazTest.test1RemoveDupesFromArray" />
396
         <item itemvalue="JUnit.ArrazTest.test2CopyArrayByInterator" />
405
         <item itemvalue="JUnit.ArrazTest.test2CopyArrayByInterator" />
397
         <item itemvalue="JUnit.ArrazTest.test1CopyArrayByInterator" />
406
         <item itemvalue="JUnit.ArrazTest.test1CopyArrayByInterator" />
398
       </list>
407
       </list>
412
       <workItem from="1543958998826" duration="113000" />
421
       <workItem from="1543958998826" duration="113000" />
413
       <workItem from="1544020724645" duration="762000" />
422
       <workItem from="1544020724645" duration="762000" />
414
       <workItem from="1544059628498" duration="1362000" />
423
       <workItem from="1544059628498" duration="1362000" />
415
-      <workItem from="1544064536860" duration="12053000" />
424
+      <workItem from="1544064536860" duration="12499000" />
425
+      <workItem from="1544144402835" duration="7928000" />
416
     </task>
426
     </task>
417
     <task id="LOCAL-00001" summary="readme and docs">
427
     <task id="LOCAL-00001" summary="readme and docs">
418
       <created>1544021313039</created>
428
       <created>1544021313039</created>
425
     <servers />
435
     <servers />
426
   </component>
436
   </component>
427
   <component name="TestHistory">
437
   <component name="TestHistory">
428
-    <history-entry file="ArrazTest - 2018.12.06 at 07h 27m 20s.xml">
438
+    <history-entry file="ArrazTest - 2018.12.06 at 20h 01m 34s.xml">
429
       <configuration name="ArrazTest" configurationId="JUnit" />
439
       <configuration name="ArrazTest" configurationId="JUnit" />
430
     </history-entry>
440
     </history-entry>
431
-    <history-entry file="ArrazTest - 2018.12.06 at 07h 37m 07s.xml">
432
-      <configuration name="ArrazTest" configurationId="JUnit" />
441
+    <history-entry file="ArrazTest_test1RemoveDupesFromArray - 2018.12.06 at 20h 40m 58s.xml">
442
+      <configuration name="ArrazTest.test1RemoveDupesFromArray" configurationId="JUnit" />
433
     </history-entry>
443
     </history-entry>
434
-    <history-entry file="ArrazTest - 2018.12.06 at 07h 53m 14s.xml">
435
-      <configuration name="ArrazTest" configurationId="JUnit" />
444
+    <history-entry file="ArrazTest_test1RemoveDupesFromArray - 2018.12.06 at 20h 42m 02s.xml">
445
+      <configuration name="ArrazTest.test1RemoveDupesFromArray" configurationId="JUnit" />
436
     </history-entry>
446
     </history-entry>
437
-    <history-entry file="ArrazTest - 2018.12.06 at 07h 53m 53s.xml">
447
+    <history-entry file="ArrazTest - 2018.12.07 at 08h 22m 44s.xml">
438
       <configuration name="ArrazTest" configurationId="JUnit" />
448
       <configuration name="ArrazTest" configurationId="JUnit" />
439
     </history-entry>
449
     </history-entry>
440
-    <history-entry file="ArrazTest - 2018.12.06 at 07h 54m 44s.xml">
450
+    <history-entry file="ArrazTest - 2018.12.07 at 08h 22m 48s.xml">
441
       <configuration name="ArrazTest" configurationId="JUnit" />
451
       <configuration name="ArrazTest" configurationId="JUnit" />
442
     </history-entry>
452
     </history-entry>
443
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 06m 43s.xml">
453
+    <history-entry file="ArrazTest - 2018.12.07 at 08h 30m 08s.xml">
444
       <configuration name="ArrazTest" configurationId="JUnit" />
454
       <configuration name="ArrazTest" configurationId="JUnit" />
445
     </history-entry>
455
     </history-entry>
446
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 07m 08s.xml">
456
+    <history-entry file="ArrazTest - 2018.12.07 at 08h 36m 40s.xml">
447
       <configuration name="ArrazTest" configurationId="JUnit" />
457
       <configuration name="ArrazTest" configurationId="JUnit" />
448
     </history-entry>
458
     </history-entry>
449
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 09m 40s.xml">
459
+    <history-entry file="ArrazTest - 2018.12.07 at 08h 38m 07s.xml">
450
       <configuration name="ArrazTest" configurationId="JUnit" />
460
       <configuration name="ArrazTest" configurationId="JUnit" />
451
     </history-entry>
461
     </history-entry>
452
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 10m 34s.xml">
462
+    <history-entry file="ArrazTest - 2018.12.07 at 09h 15m 22s.xml">
453
       <configuration name="ArrazTest" configurationId="JUnit" />
463
       <configuration name="ArrazTest" configurationId="JUnit" />
454
     </history-entry>
464
     </history-entry>
455
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 11m 09s.xml">
465
+    <history-entry file="ArrazTest - 2018.12.07 at 09h 36m 49s.xml">
456
       <configuration name="ArrazTest" configurationId="JUnit" />
466
       <configuration name="ArrazTest" configurationId="JUnit" />
457
     </history-entry>
467
     </history-entry>
458
   </component>
468
   </component>
459
   <component name="TimeTrackingManager">
469
   <component name="TimeTrackingManager">
460
-    <option name="totallyTimeSpent" value="16637000" />
470
+    <option name="totallyTimeSpent" value="25011000" />
461
   </component>
471
   </component>
462
   <component name="ToolWindowManager">
472
   <component name="ToolWindowManager">
463
-    <frame x="0" y="23" width="1280" height="709" extended-state="1" />
464
-    <editor active="true" />
473
+    <frame x="0" y="23" width="1280" height="709" extended-state="0" />
465
     <layout>
474
     <layout>
466
       <window_info content_ui="combo" id="Project" order="0" weight="0.18659128" />
475
       <window_info content_ui="combo" id="Project" order="0" weight="0.18659128" />
467
       <window_info id="Structure" order="1" weight="0.24959612" />
476
       <window_info id="Structure" order="1" weight="0.24959612" />
470
       <window_info id="Capture Tool" order="4" />
479
       <window_info id="Capture Tool" order="4" />
471
       <window_info id="UI Designer" order="5" />
480
       <window_info id="UI Designer" order="5" />
472
       <window_info id="Favorites" order="6" side_tool="true" />
481
       <window_info id="Favorites" order="6" side_tool="true" />
473
-      <window_info anchor="bottom" id="Messages" weight="0.32996634" />
474
       <window_info anchor="bottom" id="Message" order="0" />
482
       <window_info anchor="bottom" id="Message" order="0" />
475
       <window_info anchor="bottom" id="Find" order="1" />
483
       <window_info anchor="bottom" id="Find" order="1" />
476
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32996634" />
477
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
484
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32996634" />
485
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.39730638" />
478
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
486
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
479
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
487
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
480
       <window_info anchor="bottom" id="TODO" order="6" />
488
       <window_info anchor="bottom" id="TODO" order="6" />
481
-      <window_info anchor="bottom" id="Terminal" order="7" />
482
-      <window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
489
+      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32996634" />
490
+      <window_info anchor="bottom" id="Event Log" order="8" side_tool="true" weight="0.32996634" />
483
       <window_info anchor="bottom" id="Version Control" order="9" />
491
       <window_info anchor="bottom" id="Version Control" order="9" />
484
       <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
492
       <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
493
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32996634" />
485
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
494
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
486
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
495
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
487
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
496
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
500
       <window_info id="Capture Tool" order="4" />
509
       <window_info id="Capture Tool" order="4" />
501
       <window_info id="UI Designer" order="5" />
510
       <window_info id="UI Designer" order="5" />
502
       <window_info id="Favorites" order="6" side_tool="true" />
511
       <window_info id="Favorites" order="6" side_tool="true" />
503
-      <window_info anchor="bottom" id="Messages" order="0" weight="0.32996634" />
504
-      <window_info anchor="bottom" id="Message" order="1" />
505
-      <window_info anchor="bottom" id="Find" order="2" />
506
-      <window_info active="true" anchor="bottom" id="Run" order="3" visible="true" weight="0.32996634" />
507
-      <window_info anchor="bottom" id="Debug" order="4" weight="0.4" />
508
-      <window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
509
-      <window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
510
-      <window_info anchor="bottom" id="TODO" order="7" />
511
-      <window_info anchor="bottom" id="Terminal" order="8" />
512
-      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
513
-      <window_info anchor="bottom" id="Version Control" order="10" />
514
-      <window_info anchor="bottom" id="Database Changes" order="11" show_stripe_button="false" />
512
+      <window_info anchor="bottom" id="Message" order="0" />
513
+      <window_info anchor="bottom" id="Find" order="1" />
514
+      <window_info anchor="bottom" id="Run" order="2" weight="0.32996634" />
515
+      <window_info anchor="bottom" id="Debug" order="3" visible="true" weight="0.39730638" />
516
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
517
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
518
+      <window_info anchor="bottom" id="TODO" order="6" />
519
+      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32996634" />
520
+      <window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
521
+      <window_info anchor="bottom" id="Version Control" order="9" />
522
+      <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
523
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32996634" />
515
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
524
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
516
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
525
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
517
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
526
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
534
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
543
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
535
   </component>
544
   </component>
536
   <component name="editorHistoryManager">
545
   <component name="editorHistoryManager">
537
-    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
538
-      <provider selected="true" editor-type-id="text-editor" />
539
-    </entry>
540
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
546
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
541
       <provider selected="true" editor-type-id="text-editor">
547
       <provider selected="true" editor-type-id="text-editor">
542
         <state relative-caret-position="225">
548
         <state relative-caret-position="225">
551
         </state>
557
         </state>
552
       </provider>
558
       </provider>
553
     </entry>
559
     </entry>
560
+    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
561
+      <provider selected="true" editor-type-id="text-editor" />
562
+    </entry>
554
     <entry file="file://$PROJECT_DIR$/README.md">
563
     <entry file="file://$PROJECT_DIR$/README.md">
555
       <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
564
       <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
556
         <state split_layout="SECOND">
565
         <state split_layout="SECOND">
563
     </entry>
572
     </entry>
564
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
573
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
565
       <provider selected="true" editor-type-id="text-editor">
574
       <provider selected="true" editor-type-id="text-editor">
566
-        <state relative-caret-position="181">
567
-          <caret line="282" column="25" selection-start-line="282" selection-start-column="25" selection-end-line="282" selection-end-column="25" />
575
+        <state relative-caret-position="292">
576
+          <caret line="373" column="45" selection-start-line="373" selection-start-column="45" selection-end-line="373" selection-end-column="45" />
568
           <folding>
577
           <folding>
569
             <element signature="imports" expanded="true" />
578
             <element signature="imports" expanded="true" />
570
           </folding>
579
           </folding>
573
     </entry>
582
     </entry>
574
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
583
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
575
       <provider selected="true" editor-type-id="text-editor">
584
       <provider selected="true" editor-type-id="text-editor">
576
-        <state relative-caret-position="97">
577
-          <caret line="112" column="20" lean-forward="true" selection-start-line="112" selection-start-column="20" selection-end-line="112" selection-end-column="20" />
585
+        <state relative-caret-position="231">
586
+          <caret line="189" column="4" selection-start-line="189" selection-start-column="4" selection-end-line="189" selection-end-column="4" />
578
           <folding>
587
           <folding>
579
             <element signature="imports" expanded="true" />
588
             <element signature="imports" expanded="true" />
580
-            <element signature="e#351#352#0" expanded="true" />
581
-            <element signature="e#385#386#0" expanded="true" />
582
-            <element signature="e#456#457#0" expanded="true" />
583
-            <element signature="e#497#498#0" expanded="true" />
584
-            <element signature="e#1551#1560#0" expanded="true" />
589
+            <element signature="e#3653#3654#0" expanded="true" />
590
+            <element signature="e#3679#3680#0" expanded="true" />
585
           </folding>
591
           </folding>
586
         </state>
592
         </state>
587
       </provider>
593
       </provider>

+ 1
- 1
arraz/arraz.iml Voir le fichier

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4
     <output url="file://$MODULE_DIR$/target/classes" />
4
     <output url="file://$MODULE_DIR$/target/classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
     <content url="file://$MODULE_DIR$">
6
     <content url="file://$MODULE_DIR$">

+ 12
- 0
arraz/pom.xml Voir le fichier

7
     <groupId>rocks.zipcode.arraysgonewild</groupId>
7
     <groupId>rocks.zipcode.arraysgonewild</groupId>
8
     <artifactId>arraz</artifactId>
8
     <artifactId>arraz</artifactId>
9
     <version>1.0-SNAPSHOT</version>
9
     <version>1.0-SNAPSHOT</version>
10
+    <build>
11
+        <plugins>
12
+            <plugin>
13
+                <groupId>org.apache.maven.plugins</groupId>
14
+                <artifactId>maven-compiler-plugin</artifactId>
15
+                <configuration>
16
+                    <source>8</source>
17
+                    <target>8</target>
18
+                </configuration>
19
+            </plugin>
20
+        </plugins>
21
+    </build>
10
     <dependencies>
22
     <dependencies>
11
         <dependency>
23
         <dependency>
12
             <groupId>junit</groupId>
24
             <groupId>junit</groupId>

+ 51
- 16
arraz/src/main/java/Arraz.java Voir le fichier

2
 import java.util.Arrays;
2
 import java.util.Arrays;
3
 import java.util.Iterator;
3
 import java.util.Iterator;
4
 import java.util.List;
4
 import java.util.List;
5
+import java.util.stream.Stream;
5
 
6
 
6
 public class Arraz {
7
 public class Arraz {
7
 
8
 
122
     }
123
     }
123
 
124
 
124
     public int[] removeDupesFromArray(int[] arr) {
125
     public int[] removeDupesFromArray(int[] arr) {
125
-        boolean duplicate = false;
126
-        int index = 0;
127
-        int[] newArr = new int[arr.length];
128
-        for(int i = 0;i<arr.length; i++){
129
-            for(int j = i+1; j <arr.length; j++){
130
-                if(arr[i] == arr[j])
131
-                    duplicate = true;
132
-            }
133
-            if(!duplicate) {
134
-                newArr[index] = arr[i];
135
-                index++;
136
-            }
137
-
138
-        }
139
-        return newArr;
126
+       // ArrayList<Integer> list = new ArrayList<Integer>(Arrays.asList(arr));
127
+       // return newArr;
128
+        return null;
140
     }
129
     }
141
-p
142
 
130
 
143
     public int find2ndLargestValueFromArray(int[] arr) {
131
     public int find2ndLargestValueFromArray(int[] arr) {
144
         int max = Integer.MIN_VALUE;
132
         int max = Integer.MIN_VALUE;
154
 
142
 
155
         return prev;
143
         return prev;
156
     }
144
     }
145
+
146
+    public List<Integer> makeMeAnArrayListFromArray(int[] arr) {
147
+        return null;
148
+    }
149
+
150
+    public int[] makemeAnArrayFromArrayList(List<Integer> list) {
151
+
152
+        int[] arr = new int[list.size()];
153
+        for(int i = 0; i<list.size();i++){
154
+            arr[i] = list.get(i);
155
+        }
156
+        return arr;
157
+    }
158
+
159
+    public boolean check2ArraysForEqual(int[] arr, int[] arr2) {
160
+
161
+        if(arr.length != arr2.length)
162
+            return false;
163
+
164
+        for(int i = 0; i<arr.length;i++){
165
+            if(arr[i] != arr2[i])
166
+                return false;
167
+        }
168
+        return true;
169
+    }
170
+
171
+    public int averageArrayWithoutMaxMin(int[] arr) {
172
+        int sum = 0;
173
+        int count = 0;
174
+        MaxMin maxMin = findMaxMin(arr);
175
+        for(int n: arr){
176
+            if(n!= maxMin.max && n != maxMin.min) {
177
+                sum += n;
178
+                count += 1;
179
+            }
180
+        }
181
+        return sum/count;
182
+    }
183
+
184
+    public boolean arrayHas65and77(int[] arr) {
185
+        for(int n : arr) {
186
+            if (n != 65 || n != 77)
187
+                return false;
188
+        }
189
+        return true;
190
+    }
191
+
157
 }
192
 }

+ 98
- 0
arraz/src/test/java/ArrazTest.java Voir le fichier

1
 import junit.framework.Assert;
1
 import junit.framework.Assert;
2
 import org.junit.Test;
2
 import org.junit.Test;
3
 
3
 
4
+import java.util.ArrayList;
5
+import java.util.Arrays;
6
+import java.util.List;
7
+
4
 import static org.junit.Assert.*;
8
 import static org.junit.Assert.*;
5
 
9
 
6
 public class ArrazTest {
10
 public class ArrazTest {
256
         Assert.assertEquals(expected[0], actual[0]);
260
         Assert.assertEquals(expected[0], actual[0]);
257
         Assert.assertEquals(expected[1], actual[1]);
261
         Assert.assertEquals(expected[1], actual[1]);
258
         Assert.assertEquals(expected[2], actual[2]);
262
         Assert.assertEquals(expected[2], actual[2]);
263
+        Assert.assertEquals(expected.length, actual.length);
259
     }
264
     }
260
 
265
 
261
     @Test
266
     @Test
284
         int actual = arraz.find2ndLargestValueFromArray(arr);
289
         int actual = arraz.find2ndLargestValueFromArray(arr);
285
         Assert.assertEquals(expected, actual);
290
         Assert.assertEquals(expected, actual);
286
     }
291
     }
292
+
293
+       @Test
294
+       public void test1MakeMeAnArrayListFromArray(){
295
+           int[] arr = {1,5,8};
296
+
297
+           List<Integer> list = arraz.makeMeAnArrayListFromArray(arr);
298
+         //  Assert.assertEquals(list.containsAll(Arrays.asList(arr)));
299
+
300
+       }
301
+
302
+       @Test
303
+       public void test2MakeMeAnArrayListFromArray() {
304
+
305
+            int[] arr = {1,5,8};
306
+            List<Integer> list = arraz.makeMeAnArrayListFromArray(arr);
307
+
308
+       }
309
+
310
+       @Test
311
+       public void test1MakeMeAnArrayFromArrayList(){
312
+            List<Integer> list = new ArrayList<>();
313
+            list.add(4);
314
+            list.add(8);
315
+            list.add(3);
316
+
317
+            int[] arr = arraz.makemeAnArrayFromArrayList(list);
318
+            Assert.assertEquals(list.size(), arr.length);
319
+       }
320
+
321
+
322
+        @Test
323
+        public void test2MakeMeAnArrayFromArrayList(){
324
+             List<Integer> list = new ArrayList<>();
325
+             list.add(14);
326
+             list.add(80);
327
+             list.add(13);
328
+
329
+             int[] arr = arraz.makemeAnArrayFromArrayList(list);
330
+             Assert.assertEquals(list.size(), arr.length);
331
+        }
332
+
333
+           @Test
334
+           public void test1Check2ArraysForEqual(){
335
+               int[] arr = new int[]{5,3,1,8};
336
+               int[] arr2 = new int[]{5,3,1,8};
337
+               boolean expected = true;
338
+               boolean actual = arraz.check2ArraysForEqual(arr, arr2);
339
+               Assert.assertEquals(expected, actual);
340
+           }
341
+
342
+           @Test
343
+           public void test2Check2ArraysForEqual(){
344
+
345
+                int[] arr = new int[]{3,9,8};
346
+                int[] arr2 = new int[]{5,3,1,8};
347
+
348
+                boolean expected = false;
349
+
350
+                boolean actual = arraz.check2ArraysForEqual(arr, arr2);
351
+                Assert.assertEquals(expected, actual);
352
+           }
353
+
354
+            @Test
355
+            public void test1AverageArrayWithoutMaxMin(){
356
+                int[] arr = new int[]{6,8,9,1};
357
+                int expected = 7;
358
+                int actual = arraz.averageArrayWithoutMaxMin(arr);
359
+                Assert.assertEquals(expected, actual);
360
+            }
361
+
362
+            @Test
363
+            public void test2AverageArrayWithoutMaxMin(){
364
+                int[] arr = new int[]{1,3,6};
365
+                int expected = 3;
366
+                int actual = arraz.averageArrayWithoutMaxMin(arr);
367
+                Assert.assertEquals(expected, actual);
368
+            }
369
+
370
+            @Test
371
+            public void test1ArrayHas65and77(){
372
+                int[] arr = new int[]{65,18,9,77};
373
+                boolean expected = true;
374
+                boolean actual = arraz.arrayHas65and77(arr);
375
+                Assert.assertEquals(expected, actual);
376
+            }
377
+
378
+            @Test
379
+            public void test2ArrayHas65and77(){
380
+                int[] arr = new int[]{51,83,96};
381
+                boolean expected = false;
382
+                boolean actual = arraz.arrayHas65and77(arr);
383
+                Assert.assertEquals(expected, actual);
384
+            }
287
 }
385
 }