Seth před 6 roky
rodič
revize
208b5cada7
3 změnil soubory, kde provedl 170 přidání a 93 odebrání
  1. 118
    87
      .idea/workspace.xml
  2. 18
    2
      arraz/src/main/java/Arraz.java
  3. 34
    4
      arraz/src/test/java/ArrazTest.java

+ 118
- 87
.idea/workspace.xml Zobrazit soubor

@@ -2,6 +2,7 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="3455511b-a100-4bbd-b07c-68f009bc8dbc" name="Default" comment="">
5
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
5 6
       <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
6 7
       <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
7 8
     </list>
@@ -22,14 +23,14 @@
22 23
       </usages-collector>
23 24
       <usages-collector id="statistics.file.types.edit">
24 25
         <counts>
25
-          <entry key="JAVA" value="9498" />
26
+          <entry key="JAVA" value="11042" />
26 27
           <entry key="XML" value="3" />
27 28
         </counts>
28 29
       </usages-collector>
29 30
       <usages-collector id="statistics.file.types.open">
30 31
         <counts>
31 32
           <entry key="CLASS" value="1" />
32
-          <entry key="JAVA" value="4" />
33
+          <entry key="JAVA" value="5" />
33 34
           <entry key="XML" value="3" />
34 35
         </counts>
35 36
       </usages-collector>
@@ -38,27 +39,23 @@
38 39
   <component name="FileEditorManager">
39 40
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
40 41
       <file pinned="false" current-in-tab="false">
41
-        <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
42
-          <provider selected="true" editor-type-id="text-editor">
43
-            <state relative-caret-position="358">
44
-              <caret line="323" selection-start-line="323" selection-end-line="323" />
45
-              <folding>
46
-                <element signature="imports" expanded="true" />
47
-                <element signature="e#4388#4389#0" expanded="true" />
48
-                <element signature="e#4411#4412#0" expanded="true" />
49
-              </folding>
42
+        <entry file="file://$PROJECT_DIR$/README.md">
43
+          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
44
+            <state split_layout="SPLIT">
45
+              <first_editor relative-caret-position="306">
46
+                <caret line="69" column="5" selection-start-line="69" selection-start-column="5" selection-end-line="69" selection-end-column="5" />
47
+              </first_editor>
48
+              <second_editor />
50 49
             </state>
51 50
           </provider>
52 51
         </entry>
53 52
       </file>
54
-      <file pinned="false" current-in-tab="false">
53
+      <file pinned="false" current-in-tab="true">
55 54
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
56 55
           <provider selected="true" editor-type-id="text-editor">
57
-            <state relative-caret-position="319">
58
-              <caret line="141" column="45" selection-start-line="141" selection-start-column="45" selection-end-line="141" selection-end-column="45" />
56
+            <state relative-caret-position="285">
57
+              <caret line="130" column="19" selection-start-line="130" selection-start-column="19" selection-end-line="130" selection-end-column="19" />
59 58
               <folding>
60
-                <element signature="e#3351#3352#0" expanded="true" />
61
-                <element signature="e#3376#3377#0" expanded="true" />
62 59
                 <element signature="e#3440#3441#0" expanded="true" />
63 60
                 <element signature="e#3482#3483#0" expanded="true" />
64 61
                 <element signature="e#3556#3557#0" expanded="true" />
@@ -70,14 +67,14 @@
70 67
           </provider>
71 68
         </entry>
72 69
       </file>
73
-      <file pinned="false" current-in-tab="true">
74
-        <entry file="file://$PROJECT_DIR$/README.md">
75
-          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
76
-            <state split_layout="SPLIT">
77
-              <first_editor relative-caret-position="306">
78
-                <caret line="69" column="5" selection-start-line="69" selection-start-column="5" selection-end-line="69" selection-end-column="5" />
79
-              </first_editor>
80
-              <second_editor />
70
+      <file pinned="false" current-in-tab="false">
71
+        <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
72
+          <provider selected="true" editor-type-id="text-editor">
73
+            <state relative-caret-position="253">
74
+              <caret line="256" column="72" selection-start-line="256" selection-start-column="72" selection-end-line="256" selection-end-column="72" />
75
+              <folding>
76
+                <element signature="imports" expanded="true" />
77
+              </folding>
81 78
             </state>
82 79
           </provider>
83 80
         </entry>
@@ -127,10 +124,10 @@
127 124
       <list>
128 125
         <option value="$PROJECT_DIR$/README.md" />
129 126
         <option value="$PROJECT_DIR$/arraz/pom.xml" />
130
-        <option value="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" />
131 127
         <option value="$PROJECT_DIR$/arraz/src/main/java/MaxMin.java" />
132
-        <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
128
+        <option value="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" />
133 129
         <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
130
+        <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
134 131
       </list>
135 132
     </option>
136 133
   </component>
@@ -203,6 +200,14 @@
203 200
             <path>
204 201
               <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
205 202
               <item name="ArraysGoneWild" type="462c0819:PsiDirectoryNode" />
203
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
204
+              <item name="src" type="462c0819:PsiDirectoryNode" />
205
+              <item name="test" type="462c0819:PsiDirectoryNode" />
206
+              <item name="java" type="462c0819:PsiDirectoryNode" />
207
+            </path>
208
+            <path>
209
+              <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
210
+              <item name="ArraysGoneWild" type="462c0819:PsiDirectoryNode" />
206 211
               <item name="DocumentationOnArrays" type="462c0819:PsiDirectoryNode" />
207 212
             </path>
208 213
           </expand>
@@ -215,7 +220,7 @@
215 220
     <property name="GO_FMT" value="false" />
216 221
     <property name="WebServerToolWindowFactoryState" value="false" />
217 222
     <property name="aspect.path.notification.shown" value="true" />
218
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544192715898" />
223
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544205690510" />
219 224
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
220 225
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
221 226
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
@@ -245,7 +250,7 @@
245 250
       </list>
246 251
     </option>
247 252
   </component>
248
-  <component name="RunManager" selected="JUnit.ArrazTest.testCheck2ArraysForEqual2">
253
+  <component name="RunManager" selected="JUnit.ArrazTest.testFind2ndLargestFromArray1">
249 254
     <configuration default="true" type="Applet" factoryName="Applet">
250 255
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
251 256
       <method v="2">
@@ -267,44 +272,44 @@
267 272
         <option name="Make" enabled="true" />
268 273
       </method>
269 274
     </configuration>
270
-    <configuration name="ArrazTest.testCheck2ArraysForEqual1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
275
+    <configuration name="ArrazTest.testArrayHas65and771" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
271 276
       <module name="arraz" />
272 277
       <option name="PACKAGE_NAME" value="" />
273 278
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
274
-      <option name="METHOD_NAME" value="testCheck2ArraysForEqual1" />
279
+      <option name="METHOD_NAME" value="testArrayHas65and771" />
275 280
       <option name="TEST_OBJECT" value="method" />
276 281
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
277 282
       <method v="2">
278 283
         <option name="Make" enabled="true" />
279 284
       </method>
280 285
     </configuration>
281
-    <configuration name="ArrazTest.testCheck2ArraysForEqual2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
286
+    <configuration name="ArrazTest.testArrayHas65and772" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
282 287
       <module name="arraz" />
283 288
       <option name="PACKAGE_NAME" value="" />
284 289
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
285
-      <option name="METHOD_NAME" value="testCheck2ArraysForEqual2" />
290
+      <option name="METHOD_NAME" value="testArrayHas65and772" />
286 291
       <option name="TEST_OBJECT" value="method" />
287 292
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
288 293
       <method v="2">
289 294
         <option name="Make" enabled="true" />
290 295
       </method>
291 296
     </configuration>
292
-    <configuration name="ArrazTest.testMakeMeAnArrayFromArrayList2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
297
+    <configuration name="ArrazTest.testFind2ndLargestFromArray1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
293 298
       <module name="arraz" />
294 299
       <option name="PACKAGE_NAME" value="" />
295 300
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
296
-      <option name="METHOD_NAME" value="testMakeMeAnArrayFromArrayList2" />
301
+      <option name="METHOD_NAME" value="testFind2ndLargestFromArray1" />
297 302
       <option name="TEST_OBJECT" value="method" />
298 303
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
299 304
       <method v="2">
300 305
         <option name="Make" enabled="true" />
301 306
       </method>
302 307
     </configuration>
303
-    <configuration name="ArrazTest.testMakeMeAnArrayListFromArray2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
308
+    <configuration name="ArrazTest.testFind2ndLargestFromArray2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
304 309
       <module name="arraz" />
305 310
       <option name="PACKAGE_NAME" value="" />
306 311
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
307
-      <option name="METHOD_NAME" value="testMakeMeAnArrayListFromArray2" />
312
+      <option name="METHOD_NAME" value="testFind2ndLargestFromArray2" />
308 313
       <option name="TEST_OBJECT" value="method" />
309 314
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
310 315
       <method v="2">
@@ -335,19 +340,19 @@
335 340
       </method>
336 341
     </configuration>
337 342
     <list>
338
-      <item itemvalue="JUnit.ArrazTest.testMakeMeAnArrayListFromArray2" />
339 343
       <item itemvalue="JUnit.ArrazTest" />
340
-      <item itemvalue="JUnit.ArrazTest.testMakeMeAnArrayFromArrayList2" />
341
-      <item itemvalue="JUnit.ArrazTest.testCheck2ArraysForEqual1" />
342
-      <item itemvalue="JUnit.ArrazTest.testCheck2ArraysForEqual2" />
344
+      <item itemvalue="JUnit.ArrazTest.testArrayHas65and771" />
345
+      <item itemvalue="JUnit.ArrazTest.testArrayHas65and772" />
346
+      <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray2" />
347
+      <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray1" />
343 348
     </list>
344 349
     <recent_temporary>
345 350
       <list>
346
-        <item itemvalue="JUnit.ArrazTest.testCheck2ArraysForEqual2" />
347
-        <item itemvalue="JUnit.ArrazTest.testCheck2ArraysForEqual1" />
348
-        <item itemvalue="JUnit.ArrazTest.testMakeMeAnArrayFromArrayList2" />
351
+        <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray1" />
352
+        <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray2" />
353
+        <item itemvalue="JUnit.ArrazTest.testArrayHas65and772" />
354
+        <item itemvalue="JUnit.ArrazTest.testArrayHas65and771" />
349 355
         <item itemvalue="JUnit.ArrazTest" />
350
-        <item itemvalue="JUnit.ArrazTest.testMakeMeAnArrayListFromArray2" />
351 356
       </list>
352 357
     </recent_temporary>
353 358
   </component>
@@ -364,7 +369,7 @@
364 369
       <workItem from="1543955862749" duration="2347000" />
365 370
       <workItem from="1543958998826" duration="113000" />
366 371
       <workItem from="1544020724645" duration="762000" />
367
-      <workItem from="1544046933389" duration="26304000" />
372
+      <workItem from="1544046933389" duration="34996000" />
368 373
     </task>
369 374
     <task id="LOCAL-00001" summary="readme and docs">
370 375
       <created>1544021313039</created>
@@ -377,39 +382,39 @@
377 382
     <servers />
378 383
   </component>
379 384
   <component name="TestHistory">
380
-    <history-entry file="ArrazTest_testRemoveDupesFromArray1 - 2018.12.07 at 08h 15m 32s.xml">
381
-      <configuration name="ArrazTest.testRemoveDupesFromArray1" configurationId="JUnit" />
385
+    <history-entry file="ArrazTest_testArrayHas65and771 - 2018.12.07 at 10h 54m 19s.xml">
386
+      <configuration name="ArrazTest.testArrayHas65and771" configurationId="JUnit" />
382 387
     </history-entry>
383
-    <history-entry file="ArrazTest_testRemoveDupesFromArray2 - 2018.12.07 at 08h 18m 59s.xml">
384
-      <configuration name="ArrazTest.testRemoveDupesFromArray2" configurationId="JUnit" />
388
+    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 10h 54m 23s.xml">
389
+      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
385 390
     </history-entry>
386
-    <history-entry file="ArrazTest_testMakeMeAnArrayListFromArray1 - 2018.12.07 at 08h 40m 21s.xml">
387
-      <configuration name="ArrazTest.testMakeMeAnArrayListFromArray1" configurationId="JUnit" />
391
+    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin2 - 2018.12.07 at 12h 43m 07s.xml">
392
+      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin2" configurationId="JUnit" />
388 393
     </history-entry>
389
-    <history-entry file="ArrazTest_testMakeMeAnArrayListFromArray2 - 2018.12.07 at 08h 40m 23s.xml">
390
-      <configuration name="ArrazTest.testMakeMeAnArrayListFromArray2" configurationId="JUnit" />
394
+    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin - 2018.12.07 at 12h 43m 51s.xml">
395
+      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin" configurationId="JUnit" />
391 396
     </history-entry>
392
-    <history-entry file="ArrazTest_testMakeMeAnArrayFromArrayList1 - 2018.12.07 at 08h 49m 53s.xml">
393
-      <configuration name="ArrazTest.testMakeMeAnArrayFromArrayList1" configurationId="JUnit" />
397
+    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin - 2018.12.07 at 12h 44m 05s.xml">
398
+      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin" configurationId="JUnit" />
394 399
     </history-entry>
395
-    <history-entry file="ArrazTest_testMakeMeAnArrayListFromArray2 - 2018.12.07 at 08h 49m 56s.xml">
396
-      <configuration name="ArrazTest.testMakeMeAnArrayListFromArray2" configurationId="JUnit" />
400
+    <history-entry file="ArrazTest_test1SumValuesOfArray1 - 2018.12.07 at 12h 46m 13s.xml">
401
+      <configuration name="ArrazTest.test1SumValuesOfArray1" configurationId="JUnit" />
397 402
     </history-entry>
398
-    <history-entry file="ArrazTest - 2018.12.07 at 09h 00m 04s.xml">
403
+    <history-entry file="ArrazTest - 2018.12.07 at 12h 46m 18s.xml">
399 404
       <configuration name="ArrazTest" configurationId="JUnit" />
400 405
     </history-entry>
401
-    <history-entry file="ArrazTest_testMakeMeAnArrayFromArrayList2 - 2018.12.07 at 09h 11m 27s.xml">
402
-      <configuration name="ArrazTest.testMakeMeAnArrayFromArrayList2" configurationId="JUnit" />
406
+    <history-entry file="ArrazTest_testArrayHas65and771 - 2018.12.07 at 12h 51m 30s.xml">
407
+      <configuration name="ArrazTest.testArrayHas65and771" configurationId="JUnit" />
403 408
     </history-entry>
404
-    <history-entry file="ArrazTest_testCheck2ArraysForEqual1 - 2018.12.07 at 09h 13m 25s.xml">
405
-      <configuration name="ArrazTest.testCheck2ArraysForEqual1" configurationId="JUnit" />
409
+    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 12h 51m 33s.xml">
410
+      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
406 411
     </history-entry>
407
-    <history-entry file="ArrazTest_testCheck2ArraysForEqual2 - 2018.12.07 at 09h 13m 27s.xml">
408
-      <configuration name="ArrazTest.testCheck2ArraysForEqual2" configurationId="JUnit" />
412
+    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 12h 52m 03s.xml">
413
+      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
409 414
     </history-entry>
410 415
   </component>
411 416
   <component name="TimeTrackingManager">
412
-    <option name="totallyTimeSpent" value="29526000" />
417
+    <option name="totallyTimeSpent" value="38218000" />
413 418
   </component>
414 419
   <component name="ToolWindowManager">
415 420
     <frame x="1" y="23" width="1440" height="807" extended-state="0" />
@@ -444,6 +449,36 @@
444 449
       <window_info anchor="right" id="Palette&#9;" order="7" />
445 450
       <window_info anchor="right" id="Maven Projects" order="8" />
446 451
     </layout>
452
+    <layout-to-restore>
453
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26108727" />
454
+      <window_info id="Structure" order="1" weight="0.25" />
455
+      <window_info id="Image Layers" order="2" />
456
+      <window_info id="Designer" order="3" />
457
+      <window_info id="UI Designer" order="4" />
458
+      <window_info id="Capture Tool" order="5" />
459
+      <window_info id="Favorites" order="6" side_tool="true" />
460
+      <window_info anchor="bottom" id="Messages" order="0" weight="0.32867134" />
461
+      <window_info anchor="bottom" id="Database Changes" order="1" show_stripe_button="false" />
462
+      <window_info anchor="bottom" id="Message" order="2" />
463
+      <window_info anchor="bottom" id="Find" order="3" />
464
+      <window_info active="true" anchor="bottom" id="Run" order="4" visible="true" weight="0.32867134" />
465
+      <window_info anchor="bottom" id="Debug" order="5" weight="0.4" />
466
+      <window_info anchor="bottom" id="Cvs" order="6" weight="0.25" />
467
+      <window_info anchor="bottom" id="Inspection" order="7" weight="0.4" />
468
+      <window_info anchor="bottom" id="TODO" order="8" />
469
+      <window_info anchor="bottom" id="Terminal" order="9" />
470
+      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
471
+      <window_info anchor="bottom" id="Version Control" order="11" />
472
+      <window_info anchor="right" id="Commander" order="0" weight="0.4" />
473
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
474
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
475
+      <window_info anchor="right" id="Palette" order="3" />
476
+      <window_info anchor="right" id="Capture Analysis" order="4" />
477
+      <window_info anchor="right" id="Theme Preview" order="5" />
478
+      <window_info anchor="right" id="Database" order="6" />
479
+      <window_info anchor="right" id="Palette&#9;" order="7" />
480
+      <window_info anchor="right" id="Maven Projects" order="8" />
481
+    </layout-to-restore>
447 482
   </component>
448 483
   <component name="TypeScriptGeneratedFilesManager">
449 484
     <option name="version" value="1" />
@@ -487,6 +522,13 @@
487 522
         </state>
488 523
       </provider>
489 524
     </entry>
525
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/src.zip!/java/util/Set.java">
526
+      <provider selected="true" editor-type-id="text-editor">
527
+        <state relative-caret-position="386">
528
+          <caret line="189" column="17" selection-start-line="189" selection-start-column="17" selection-end-line="189" selection-end-column="17" />
529
+        </state>
530
+      </provider>
531
+    </entry>
490 532
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
491 533
       <provider selected="true" editor-type-id="text-editor">
492 534
         <state>
@@ -500,32 +542,31 @@
500 542
         </state>
501 543
       </provider>
502 544
     </entry>
503
-    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/src.zip!/java/util/Set.java">
504
-      <provider selected="true" editor-type-id="text-editor">
505
-        <state relative-caret-position="386">
506
-          <caret line="189" column="17" selection-start-line="189" selection-start-column="17" selection-end-line="189" selection-end-column="17" />
545
+    <entry file="file://$PROJECT_DIR$/README.md">
546
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
547
+        <state split_layout="SPLIT">
548
+          <first_editor relative-caret-position="306">
549
+            <caret line="69" column="5" selection-start-line="69" selection-start-column="5" selection-end-line="69" selection-end-column="5" />
550
+          </first_editor>
551
+          <second_editor />
507 552
         </state>
508 553
       </provider>
509 554
     </entry>
510 555
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
511 556
       <provider selected="true" editor-type-id="text-editor">
512
-        <state relative-caret-position="358">
513
-          <caret line="323" selection-start-line="323" selection-end-line="323" />
557
+        <state relative-caret-position="253">
558
+          <caret line="256" column="72" selection-start-line="256" selection-start-column="72" selection-end-line="256" selection-end-column="72" />
514 559
           <folding>
515 560
             <element signature="imports" expanded="true" />
516
-            <element signature="e#4388#4389#0" expanded="true" />
517
-            <element signature="e#4411#4412#0" expanded="true" />
518 561
           </folding>
519 562
         </state>
520 563
       </provider>
521 564
     </entry>
522 565
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
523 566
       <provider selected="true" editor-type-id="text-editor">
524
-        <state relative-caret-position="319">
525
-          <caret line="141" column="45" selection-start-line="141" selection-start-column="45" selection-end-line="141" selection-end-column="45" />
567
+        <state relative-caret-position="285">
568
+          <caret line="130" column="19" selection-start-line="130" selection-start-column="19" selection-end-line="130" selection-end-column="19" />
526 569
           <folding>
527
-            <element signature="e#3351#3352#0" expanded="true" />
528
-            <element signature="e#3376#3377#0" expanded="true" />
529 570
             <element signature="e#3440#3441#0" expanded="true" />
530 571
             <element signature="e#3482#3483#0" expanded="true" />
531 572
             <element signature="e#3556#3557#0" expanded="true" />
@@ -536,16 +577,6 @@
536 577
         </state>
537 578
       </provider>
538 579
     </entry>
539
-    <entry file="file://$PROJECT_DIR$/README.md">
540
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
541
-        <state split_layout="SPLIT">
542
-          <first_editor relative-caret-position="306">
543
-            <caret line="69" column="5" selection-start-line="69" selection-start-column="5" selection-end-line="69" selection-end-column="5" />
544
-          </first_editor>
545
-          <second_editor />
546
-        </state>
547
-      </provider>
548
-    </entry>
549 580
   </component>
550 581
   <component name="masterDetails">
551 582
     <states>

+ 18
- 2
arraz/src/main/java/Arraz.java Zobrazit soubor

@@ -126,8 +126,10 @@ public class Arraz {
126 126
         return integerSet.toArray(new Integer[0]);
127 127
     }
128 128
 
129
-    public double find2ndLargestValueFromArray(double[] array){
130
-        return 0.0;
129
+    public Double find2ndLargestValueFromArray(Double[] array){
130
+        Set<Double> set = new TreeSet<>(Arrays.asList(array));
131
+        Double[] newArray = set.toArray(new Double[0]);
132
+        return newArray[newArray.length - 2];
131 133
     }
132 134
 
133 135
     public List<Integer> makeMeAnArrayListFromArray(Integer[] array){
@@ -141,4 +143,18 @@ public class Arraz {
141 143
     public boolean check2ArraysForEqual(int[] array1, int[] array2){
142 144
         return Arrays.equals(array1, array2);
143 145
     }
146
+
147
+    public double averageArrayWithoutMaxMin(int[] array){
148
+        MaxMin maxMin = findMaxMinOfArray(array);
149
+        int[] noMax = removeElementFromArray(array, maxMin.getMax());
150
+        int[] noMaxMin = removeElementFromArray(noMax, maxMin.getMin());
151
+        return averageOfArray(noMaxMin);
152
+    }
153
+
154
+    public boolean arrayHas65and77(Integer[] array){
155
+        List<Integer> list = Arrays.asList(array);
156
+            if(list.contains(65) && list.contains(77)){
157
+                return true;
158
+            }else{return false;}
159
+    }
144 160
 }

+ 34
- 4
arraz/src/test/java/ArrazTest.java Zobrazit soubor

@@ -243,16 +243,18 @@ public class ArrazTest {
243 243
 
244 244
     @Test
245 245
     public void testFind2ndLargestFromArray1(){
246
-        double expected = 38.4;
247
-        double actual = testArraz.find2ndLargestValueFromArray(double1);
246
+        Double expected = 99.3;
247
+        Double[] doubleArr = new Double[]{10.4, 99.3, 89.45, 23.0, 1.1, 199.4, 199.4};
248
+        Double actual = testArraz.find2ndLargestValueFromArray(doubleArr);
248 249
 
249 250
         Assert.assertEquals(expected, actual, .01);
250 251
     }
251 252
 
252 253
     @Test
253 254
     public void testFind2ndLargestFromArray2(){
254
-        double expected = 78.9;
255
-        double actual = testArraz.find2ndLargestValueFromArray(double2);
255
+        Double expected = 3.149;
256
+        Double[] doubleArr = new Double[]{3.14, 3.14, 3.14, 3.14, 54.9};
257
+        Double actual = testArraz.find2ndLargestValueFromArray(doubleArr);
256 258
 
257 259
         Assert.assertEquals(expected, actual, .01);
258 260
     }
@@ -321,5 +323,33 @@ public class ArrazTest {
321 323
         Assert.assertFalse(testArraz.check2ArraysForEqual(arr1, expected));
322 324
     }
323 325
 
326
+    @Test
327
+    public void testAverageArrayWithoutMaxMin(){
328
+        double expected = 14.0;
329
+        double actual = testArraz.averageArrayWithoutMaxMin(arr1);
330
+
331
+        Assert.assertEquals(expected, actual, .01);
332
+    }
333
+
334
+    @Test
335
+    public void testAverageArrayWithoutMaxMin2(){
336
+        double expected = 48;
337
+        double actual = testArraz.averageArrayWithoutMaxMin(arr2);
338
+        System.out.println(actual);
339
+
340
+        Assert.assertEquals(expected, actual, .01);
341
+    }
342
+
343
+    @Test
344
+    public void testArrayHas65and771(){
345
+        Integer[] array = new Integer[]{65, 10, 34, 7, 77, 89};
346
+        Assert.assertTrue(testArraz.arrayHas65and77(array));
347
+    }
348
+
349
+    @Test
350
+    public void testArrayHas65and772(){
351
+        Integer[] array = new Integer[]{3, 1, 9999, 5, 44};
352
+        Assert.assertFalse(testArraz.arrayHas65and77(array));
353
+    }
324 354
 
325 355
 }