8 Revīzijas

Autors SHA1 Ziņojums Datums
  Seth 208b5cada7 2ndLargest 6 gadus atpakaļ
  Seth ca56de5ef1 compare2 6 gadus atpakaļ
  Seth 1546ea5fb7 arraytolist 6 gadus atpakaļ
  Seth 648e017ddd linkedhashset 6 gadus atpakaļ
  Seth 37ebc6b353 maxmin 6 gadus atpakaļ
  Seth 15162fc632 iterator 6 gadus atpakaļ
  Seth eaade35bd8 insertfail 6 gadus atpakaļ
  Seth aac969f38d remove element 6 gadus atpakaļ

+ 1
- 1
.idea/ArraysGoneWild.iml Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
4 4
     <exclude-output />
5 5
     <content url="file://$MODULE_DIR$" />
6 6
     <orderEntry type="inheritedJdk" />

+ 1
- 1
.idea/compiler.xml Parādīt failu

@@ -10,7 +10,7 @@
10 10
       </profile>
11 11
     </annotationProcessing>
12 12
     <bytecodeTargetLevel>
13
-      <module name="arraz" target="1.5" />
13
+      <module name="arraz" target="8" />
14 14
     </bytecodeTargetLevel>
15 15
   </component>
16 16
 </project>

+ 1
- 0
.idea/misc.xml Parādīt failu

@@ -7,4 +7,5 @@
7 7
       </list>
8 8
     </option>
9 9
   </component>
10
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
10 11
 </project>

+ 157
- 83
.idea/workspace.xml Parādīt failu

@@ -23,14 +23,15 @@
23 23
       </usages-collector>
24 24
       <usages-collector id="statistics.file.types.edit">
25 25
         <counts>
26
-          <entry key="JAVA" value="4128" />
26
+          <entry key="JAVA" value="11042" />
27 27
           <entry key="XML" value="3" />
28 28
         </counts>
29 29
       </usages-collector>
30 30
       <usages-collector id="statistics.file.types.open">
31 31
         <counts>
32
-          <entry key="JAVA" value="1" />
33
-          <entry key="XML" value="1" />
32
+          <entry key="CLASS" value="1" />
33
+          <entry key="JAVA" value="5" />
34
+          <entry key="XML" value="3" />
34 35
         </counts>
35 36
       </usages-collector>
36 37
     </session>
@@ -38,26 +39,39 @@
38 39
   <component name="FileEditorManager">
39 40
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
40 41
       <file pinned="false" current-in-tab="false">
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 />
49
+            </state>
50
+          </provider>
51
+        </entry>
52
+      </file>
53
+      <file pinned="false" current-in-tab="true">
41 54
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
42 55
           <provider selected="true" editor-type-id="text-editor">
43 56
             <state relative-caret-position="285">
44
-              <caret line="79" column="24" selection-start-line="79" selection-start-column="24" selection-end-line="79" selection-end-column="24" />
57
+              <caret line="130" column="19" selection-start-line="130" selection-start-column="19" selection-end-line="130" selection-end-column="19" />
45 58
               <folding>
46
-                <element signature="imports" expanded="true" />
47
-                <element signature="e#399#400#0" expanded="true" />
48
-                <element signature="e#451#452#0" expanded="true" />
49
-                <element signature="e#515#516#0" expanded="true" />
50
-                <element signature="e#556#557#0" expanded="true" />
59
+                <element signature="e#3440#3441#0" expanded="true" />
60
+                <element signature="e#3482#3483#0" expanded="true" />
61
+                <element signature="e#3556#3557#0" expanded="true" />
62
+                <element signature="e#3603#3604#0" expanded="true" />
63
+                <element signature="e#3677#3678#0" expanded="true" />
64
+                <element signature="e#3714#3715#0" expanded="true" />
51 65
               </folding>
52 66
             </state>
53 67
           </provider>
54 68
         </entry>
55 69
       </file>
56
-      <file pinned="false" current-in-tab="true">
70
+      <file pinned="false" current-in-tab="false">
57 71
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
58 72
           <provider selected="true" editor-type-id="text-editor">
59
-            <state relative-caret-position="313">
60
-              <caret line="161" column="49" selection-start-line="161" selection-start-column="49" selection-end-line="161" selection-end-column="49" />
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" />
61 75
               <folding>
62 76
                 <element signature="imports" expanded="true" />
63 77
               </folding>
@@ -66,22 +80,10 @@
66 80
         </entry>
67 81
       </file>
68 82
       <file pinned="false" current-in-tab="false">
69
-        <entry file="file://$PROJECT_DIR$/README.md">
70
-          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
71
-            <state split_layout="SPLIT">
72
-              <first_editor relative-caret-position="381">
73
-                <caret line="74" column="117" selection-start-line="74" selection-start-column="113" selection-end-line="74" selection-end-column="117" />
74
-              </first_editor>
75
-              <second_editor />
76
-            </state>
77
-          </provider>
78
-        </entry>
79
-      </file>
80
-      <file pinned="false" current-in-tab="false">
81 83
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
82 84
           <provider selected="true" editor-type-id="text-editor">
83 85
             <state>
84
-              <caret column="22" lean-forward="true" selection-start-column="22" selection-end-column="22" />
86
+              <caret column="22" selection-start-column="22" selection-end-column="22" />
85 87
               <folding>
86 88
                 <element signature="e#189#190#0" expanded="true" />
87 89
                 <element signature="e#215#216#0" expanded="true" />
@@ -122,6 +124,7 @@
122 124
       <list>
123 125
         <option value="$PROJECT_DIR$/README.md" />
124 126
         <option value="$PROJECT_DIR$/arraz/pom.xml" />
127
+        <option value="$PROJECT_DIR$/arraz/src/main/java/MaxMin.java" />
125 128
         <option value="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" />
126 129
         <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
127 130
         <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
@@ -141,7 +144,8 @@
141 144
       </MavenImportingSettings>
142 145
     </option>
143 146
   </component>
144
-  <component name="ProjectFrameBounds" extendedState="6">
147
+  <component name="ProjectFrameBounds">
148
+    <option name="x" value="1" />
145 149
     <option name="y" value="23" />
146 150
     <option name="width" value="1440" />
147 151
     <option name="height" value="807" />
@@ -196,6 +200,14 @@
196 200
             <path>
197 201
               <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
198 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" />
199 211
               <item name="DocumentationOnArrays" type="462c0819:PsiDirectoryNode" />
200 212
             </path>
201 213
           </expand>
@@ -208,15 +220,15 @@
208 220
     <property name="GO_FMT" value="false" />
209 221
     <property name="WebServerToolWindowFactoryState" value="false" />
210 222
     <property name="aspect.path.notification.shown" value="true" />
211
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544103261992" />
223
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544205690510" />
212 224
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
213 225
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
214 226
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
215 227
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
216 228
     <property name="project.structure.last.edited" value="Modules" />
217
-    <property name="project.structure.proportion" value="0.0" />
218
-    <property name="project.structure.side.proportion" value="0.0" />
219
-    <property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
229
+    <property name="project.structure.proportion" value="0.15" />
230
+    <property name="project.structure.side.proportion" value="0.2" />
231
+    <property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.javacompiler" />
220 232
   </component>
221 233
   <component name="RecentsManager">
222 234
     <key name="CreateTestDialog.RecentsKey">
@@ -238,7 +250,7 @@
238 250
       </list>
239 251
     </option>
240 252
   </component>
241
-  <component name="RunManager" selected="JUnit.ArrazTest.testCopyArrayByIterator2">
253
+  <component name="RunManager" selected="JUnit.ArrazTest.testFind2ndLargestFromArray1">
242 254
     <configuration default="true" type="Applet" factoryName="Applet">
243 255
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
244 256
       <method v="2">
@@ -260,44 +272,44 @@
260 272
         <option name="Make" enabled="true" />
261 273
       </method>
262 274
     </configuration>
263
-    <configuration name="ArrazTest.testCopyArrayByIterator1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
275
+    <configuration name="ArrazTest.testArrayHas65and771" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
264 276
       <module name="arraz" />
265 277
       <option name="PACKAGE_NAME" value="" />
266 278
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
267
-      <option name="METHOD_NAME" value="testCopyArrayByIterator1" />
279
+      <option name="METHOD_NAME" value="testArrayHas65and771" />
268 280
       <option name="TEST_OBJECT" value="method" />
269 281
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
270 282
       <method v="2">
271 283
         <option name="Make" enabled="true" />
272 284
       </method>
273 285
     </configuration>
274
-    <configuration name="ArrazTest.testCopyArrayByIterator2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
286
+    <configuration name="ArrazTest.testArrayHas65and772" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
275 287
       <module name="arraz" />
276 288
       <option name="PACKAGE_NAME" value="" />
277 289
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
278
-      <option name="METHOD_NAME" value="testCopyArrayByIterator2" />
290
+      <option name="METHOD_NAME" value="testArrayHas65and772" />
279 291
       <option name="TEST_OBJECT" value="method" />
280 292
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
281 293
       <method v="2">
282 294
         <option name="Make" enabled="true" />
283 295
       </method>
284 296
     </configuration>
285
-    <configuration name="ArrazTest.testOddEvens2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
297
+    <configuration name="ArrazTest.testFind2ndLargestFromArray1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
286 298
       <module name="arraz" />
287 299
       <option name="PACKAGE_NAME" value="" />
288 300
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
289
-      <option name="METHOD_NAME" value="testOddEvens2" />
301
+      <option name="METHOD_NAME" value="testFind2ndLargestFromArray1" />
290 302
       <option name="TEST_OBJECT" value="method" />
291 303
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
292 304
       <method v="2">
293 305
         <option name="Make" enabled="true" />
294 306
       </method>
295 307
     </configuration>
296
-    <configuration name="ArrazTest.testReverseArray1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
308
+    <configuration name="ArrazTest.testFind2ndLargestFromArray2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
297 309
       <module name="arraz" />
298 310
       <option name="PACKAGE_NAME" value="" />
299 311
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
300
-      <option name="METHOD_NAME" value="testReverseArray1" />
312
+      <option name="METHOD_NAME" value="testFind2ndLargestFromArray2" />
301 313
       <option name="TEST_OBJECT" value="method" />
302 314
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
303 315
       <method v="2">
@@ -329,18 +341,18 @@
329 341
     </configuration>
330 342
     <list>
331 343
       <item itemvalue="JUnit.ArrazTest" />
332
-      <item itemvalue="JUnit.ArrazTest.testReverseArray1" />
333
-      <item itemvalue="JUnit.ArrazTest.testOddEvens2" />
334
-      <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator1" />
335
-      <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator2" />
344
+      <item itemvalue="JUnit.ArrazTest.testArrayHas65and771" />
345
+      <item itemvalue="JUnit.ArrazTest.testArrayHas65and772" />
346
+      <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray2" />
347
+      <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray1" />
336 348
     </list>
337 349
     <recent_temporary>
338 350
       <list>
339
-        <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator2" />
340
-        <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator1" />
351
+        <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray1" />
352
+        <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray2" />
353
+        <item itemvalue="JUnit.ArrazTest.testArrayHas65and772" />
354
+        <item itemvalue="JUnit.ArrazTest.testArrayHas65and771" />
341 355
         <item itemvalue="JUnit.ArrazTest" />
342
-        <item itemvalue="JUnit.ArrazTest.testReverseArray1" />
343
-        <item itemvalue="JUnit.ArrazTest.testOddEvens2" />
344 356
       </list>
345 357
     </recent_temporary>
346 358
   </component>
@@ -357,7 +369,7 @@
357 369
       <workItem from="1543955862749" duration="2347000" />
358 370
       <workItem from="1543958998826" duration="113000" />
359 371
       <workItem from="1544020724645" duration="762000" />
360
-      <workItem from="1544046933389" duration="9103000" />
372
+      <workItem from="1544046933389" duration="34996000" />
361 373
     </task>
362 374
     <task id="LOCAL-00001" summary="readme and docs">
363 375
       <created>1544021313039</created>
@@ -370,42 +382,42 @@
370 382
     <servers />
371 383
   </component>
372 384
   <component name="TestHistory">
373
-    <history-entry file="ArrazTest_testReverseArray1 - 2018.12.05 at 19h 49m 37s.xml">
374
-      <configuration name="ArrazTest.testReverseArray1" configurationId="JUnit" />
385
+    <history-entry file="ArrazTest_testArrayHas65and771 - 2018.12.07 at 10h 54m 19s.xml">
386
+      <configuration name="ArrazTest.testArrayHas65and771" configurationId="JUnit" />
375 387
     </history-entry>
376
-    <history-entry file="ArrazTest_testReverseArray1 - 2018.12.05 at 19h 51m 09s.xml">
377
-      <configuration name="ArrazTest.testReverseArray1" configurationId="JUnit" />
388
+    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 10h 54m 23s.xml">
389
+      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
378 390
     </history-entry>
379
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 13m 00s.xml">
380
-      <configuration name="ArrazTest" configurationId="JUnit" />
391
+    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin2 - 2018.12.07 at 12h 43m 07s.xml">
392
+      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin2" configurationId="JUnit" />
381 393
     </history-entry>
382
-    <history-entry file="ArrazTest_testOddEvens1 - 2018.12.05 at 20h 13m 40s.xml">
383
-      <configuration name="ArrazTest.testOddEvens1" configurationId="JUnit" />
394
+    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin - 2018.12.07 at 12h 43m 51s.xml">
395
+      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin" configurationId="JUnit" />
384 396
     </history-entry>
385
-    <history-entry file="ArrazTest_testOddEvens2 - 2018.12.05 at 20h 14m 01s.xml">
386
-      <configuration name="ArrazTest.testOddEvens2" configurationId="JUnit" />
397
+    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin - 2018.12.07 at 12h 44m 05s.xml">
398
+      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin" configurationId="JUnit" />
387 399
     </history-entry>
388
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 14m 10s.xml">
389
-      <configuration name="ArrazTest" configurationId="JUnit" />
400
+    <history-entry file="ArrazTest_test1SumValuesOfArray1 - 2018.12.07 at 12h 46m 13s.xml">
401
+      <configuration name="ArrazTest.test1SumValuesOfArray1" configurationId="JUnit" />
390 402
     </history-entry>
391
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 14m 26s.xml">
403
+    <history-entry file="ArrazTest - 2018.12.07 at 12h 46m 18s.xml">
392 404
       <configuration name="ArrazTest" configurationId="JUnit" />
393 405
     </history-entry>
394
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 21m 34s.xml">
395
-      <configuration name="ArrazTest" configurationId="JUnit" />
406
+    <history-entry file="ArrazTest_testArrayHas65and771 - 2018.12.07 at 12h 51m 30s.xml">
407
+      <configuration name="ArrazTest.testArrayHas65and771" configurationId="JUnit" />
396 408
     </history-entry>
397
-    <history-entry file="ArrazTest_testReverseArray1 - 2018.12.05 at 20h 36m 49s.xml">
398
-      <configuration name="ArrazTest.testReverseArray1" configurationId="JUnit" />
409
+    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 12h 51m 33s.xml">
410
+      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
399 411
     </history-entry>
400
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 17m 38s.xml">
401
-      <configuration name="ArrazTest" configurationId="JUnit" />
412
+    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 12h 52m 03s.xml">
413
+      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
402 414
     </history-entry>
403 415
   </component>
404 416
   <component name="TimeTrackingManager">
405
-    <option name="totallyTimeSpent" value="12325000" />
417
+    <option name="totallyTimeSpent" value="38218000" />
406 418
   </component>
407 419
   <component name="ToolWindowManager">
408
-    <frame x="0" y="23" width="1440" height="807" extended-state="6" />
420
+    <frame x="1" y="23" width="1440" height="807" extended-state="0" />
409 421
     <editor active="true" />
410 422
     <layout>
411 423
       <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26108727" />
@@ -437,6 +449,36 @@
437 449
       <window_info anchor="right" id="Palette&#9;" order="7" />
438 450
       <window_info anchor="right" id="Maven Projects" order="8" />
439 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>
440 482
   </component>
441 483
   <component name="TypeScriptGeneratedFilesManager">
442 484
     <option name="version" value="1" />
@@ -456,10 +498,41 @@
456 498
         </state>
457 499
       </provider>
458 500
     </entry>
501
+    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/MaxMin.java">
502
+      <provider selected="true" editor-type-id="text-editor">
503
+        <state>
504
+          <caret column="21" lean-forward="true" selection-start-column="21" selection-end-column="21" />
505
+          <folding>
506
+            <element signature="e#182#183#0" expanded="true" />
507
+            <element signature="e#208#209#0" expanded="true" />
508
+            <element signature="e#243#244#0" expanded="true" />
509
+            <element signature="e#273#274#0" expanded="true" />
510
+            <element signature="e#300#301#0" expanded="true" />
511
+            <element signature="e#326#327#0" expanded="true" />
512
+            <element signature="e#361#362#0" expanded="true" />
513
+            <element signature="e#391#392#0" expanded="true" />
514
+          </folding>
515
+        </state>
516
+      </provider>
517
+    </entry>
518
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/internal/runners/model/ReflectiveCallable.class">
519
+      <provider selected="true" editor-type-id="text-editor">
520
+        <state relative-caret-position="210">
521
+          <caret line="17" selection-start-line="17" selection-end-line="17" />
522
+        </state>
523
+      </provider>
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>
459 532
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
460 533
       <provider selected="true" editor-type-id="text-editor">
461 534
         <state>
462
-          <caret column="22" lean-forward="true" selection-start-column="22" selection-end-column="22" />
535
+          <caret column="22" selection-start-column="22" selection-end-column="22" />
463 536
           <folding>
464 537
             <element signature="e#189#190#0" expanded="true" />
465 538
             <element signature="e#215#216#0" expanded="true" />
@@ -472,33 +545,34 @@
472 545
     <entry file="file://$PROJECT_DIR$/README.md">
473 546
       <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
474 547
         <state split_layout="SPLIT">
475
-          <first_editor relative-caret-position="381">
476
-            <caret line="74" column="117" selection-start-line="74" selection-start-column="113" selection-end-line="74" selection-end-column="117" />
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" />
477 550
           </first_editor>
478 551
           <second_editor />
479 552
         </state>
480 553
       </provider>
481 554
     </entry>
482
-    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
555
+    <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
483 556
       <provider selected="true" editor-type-id="text-editor">
484
-        <state relative-caret-position="285">
485
-          <caret line="79" column="24" selection-start-line="79" selection-start-column="24" selection-end-line="79" selection-end-column="24" />
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" />
486 559
           <folding>
487 560
             <element signature="imports" expanded="true" />
488
-            <element signature="e#399#400#0" expanded="true" />
489
-            <element signature="e#451#452#0" expanded="true" />
490
-            <element signature="e#515#516#0" expanded="true" />
491
-            <element signature="e#556#557#0" expanded="true" />
492 561
           </folding>
493 562
         </state>
494 563
       </provider>
495 564
     </entry>
496
-    <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
565
+    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
497 566
       <provider selected="true" editor-type-id="text-editor">
498
-        <state relative-caret-position="313">
499
-          <caret line="161" column="49" selection-start-line="161" selection-start-column="49" selection-end-line="161" selection-end-column="49" />
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" />
500 569
           <folding>
501
-            <element signature="imports" expanded="true" />
570
+            <element signature="e#3440#3441#0" expanded="true" />
571
+            <element signature="e#3482#3483#0" expanded="true" />
572
+            <element signature="e#3556#3557#0" expanded="true" />
573
+            <element signature="e#3603#3604#0" expanded="true" />
574
+            <element signature="e#3677#3678#0" expanded="true" />
575
+            <element signature="e#3714#3715#0" expanded="true" />
502 576
           </folding>
503 577
         </state>
504 578
       </provider>

+ 1
- 1
arraz/arraz.iml Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 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 4
     <output url="file://$MODULE_DIR$/target/classes" />
5 5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6 6
     <content url="file://$MODULE_DIR$">

+ 81
- 4
arraz/src/main/java/Arraz.java Parādīt failu

@@ -1,5 +1,4 @@
1
-import java.util.Arrays;
2
-import java.util.Iterator;
1
+import java.util.*;
3 2
 
4 3
 public class Arraz {
5 4
 
@@ -71,13 +70,91 @@ public class Arraz {
71 70
 
72 71
     public Integer[] copyArrayByIterator(Integer[] array){
73 72
         Integer[] newArray = new Integer[array.length];
74
-        int index = 0;
75 73
         Iterator<Integer> iterator = Arrays.asList(array).iterator();
76
-        while(iterator.hasNext()){
74
+        int index = 0;
75
+        while(iterator.hasNext()) {
77 76
             newArray[index] = iterator.next();
78 77
             index++;
79 78
         }
80 79
         return newArray;
81 80
         }
82 81
 
82
+    public int[] copyArrayByLoop(int[] array){
83
+        int[] newArray = new int[array.length];
84
+        int index = 0;
85
+        for(int each:array){
86
+            newArray[index] = each;
87
+            index++;
88
+        }
89
+        return newArray;
90
+    }
91
+
92
+    public int[] removeElementFromArray(int[] array, int value){
93
+        int[] newArray = new int[array.length -1];
94
+        int index = 0;
95
+        for (int each:array) {
96
+            if(each!=value){
97
+                newArray[index] =each;
98
+                index++;
99
+            }
100
+        }
101
+        return newArray;
102
+    }
103
+
104
+    public int[] insertArrayAt(int[] array, int index, int value){
105
+        int[] newArray = new int[array.length + 1];
106
+        int counter = 0;
107
+        for (int i = 0; i < array.length-1; i++) {
108
+            if (i == index){
109
+                newArray[index] = value;
110
+                counter++;
111
+            }else {
112
+                newArray[counter] = array[i];
113
+                counter++;
114
+            }
115
+        }
116
+        return newArray;
117
+        }
118
+
119
+    public MaxMin findMaxMinOfArray(int[] array){
120
+        Arrays.sort(array);
121
+        return new MaxMin(array[array.length - 1], array[0]);
122
+    }
123
+
124
+    public Integer[] removeDupesFromArray(Integer[] array){
125
+        Set<Integer> integerSet = new LinkedHashSet<>(Arrays.asList(array));
126
+        return integerSet.toArray(new Integer[0]);
127
+    }
128
+
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];
133
+    }
134
+
135
+    public List<Integer> makeMeAnArrayListFromArray(Integer[] array){
136
+       return Arrays.asList(array);
137
+    }
138
+
139
+    public Integer[] makeMeAnArrayFromArrayList(List<Integer> list){
140
+        return list.toArray(new Integer[0]);
141
+    }
142
+
143
+    public boolean check2ArraysForEqual(int[] array1, int[] array2){
144
+        return Arrays.equals(array1, array2);
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;}
83 159
     }
160
+}

+ 25
- 0
arraz/src/main/java/MaxMin.java Parādīt failu

@@ -0,0 +1,25 @@
1
+public class MaxMin {
2
+    private int max;
3
+    private int min;
4
+
5
+    public MaxMin(int max, int min) {
6
+        this.max = max;
7
+        this.min = min;
8
+    }
9
+
10
+    public int getMax() {
11
+        return max;
12
+    }
13
+
14
+    public void setMax(int max) {
15
+        this.max = max;
16
+    }
17
+
18
+    public int getMin() {
19
+        return min;
20
+    }
21
+
22
+    public void setMin(int min) {
23
+        this.min = min;
24
+    }
25
+}

+ 194
- 3
arraz/src/test/java/ArrazTest.java Parādīt failu

@@ -4,26 +4,30 @@ import org.junit.Assert;
4 4
 import org.junit.Before;
5 5
 import org.junit.Test;
6 6
 
7
+import java.util.ArrayList;
7 8
 import java.util.Arrays;
9
+import java.util.List;
8 10
 
9 11
 
10 12
 public class ArrazTest {
11 13
 
12 14
     private Arraz testArraz;
13 15
     private OddEven oddEven1;
14
-    private OddEven oddEven2;
16
+    private MaxMin maxMin;
15 17
     private int[] arr1;
16 18
     private int[] arr2;
17 19
     private double[] double1;
20
+    private double[] double2;
18 21
 
19 22
     @Before
20 23
     public void before() {
21 24
         arr1 = new int[]{5, 10, 3, 29, 100};
22 25
         arr2 = new int[]{2, 7, 432, 89};
23 26
         double1 = new double[] {1.0, 0.5, 3.6, 38.4, 17.3, 62.0, 9.0, 3.375, 0, 3.14159};
27
+        double2 =  new double[]{6.0, 2.897, 3.1, 654.3, 5.21, 78.9};
24 28
         testArraz = new Arraz();
25 29
         oddEven1 = new OddEven(3, 2);
26
-        oddEven2 = new OddEven(2,2);
30
+        maxMin = new MaxMin(100,3);
27 31
     }
28 32
 
29 33
     @Test
@@ -107,7 +111,7 @@ public class ArrazTest {
107 111
         int[] expected =new int[]{100, 29, 3, 10, 5};
108 112
         int[] actual = testArraz.reverseArray(arr1);
109 113
 
110
-        Assert.assertTrue(Arrays.equals(expected, actual));
114
+        Assert.assertArrayEquals(expected, actual);
111 115
     }
112 116
 
113 117
     @Test
@@ -161,4 +165,191 @@ public class ArrazTest {
161 165
 
162 166
         Assert.assertArrayEquals(expected, actual);
163 167
     }
168
+
169
+    @Test
170
+    public void testCopyArrayByLoop1(){
171
+        int[] expected = arr1;
172
+        int[] actual = testArraz.copyArrayByLoop(arr1);
173
+
174
+        Assert.assertArrayEquals(expected, actual);
175
+    }
176
+
177
+    @Test
178
+    public void testCopyArrayByLoop2(){
179
+        Assert.assertFalse(Arrays.equals(arr1, testArraz.copyArrayByLoop(arr2)));
180
+    }
181
+
182
+    @Test
183
+    public void testRemoveElementFromArray1(){
184
+        int[] expected = new int[]{5, 10, 29, 100};
185
+        int[] actual = testArraz.removeElementFromArray(arr1, 3);
186
+
187
+        Assert.assertArrayEquals(expected, actual);
188
+    }
189
+
190
+    @Test
191
+    public void testRemoveElementFromArray2(){
192
+        int[] expected = new int[]{2, 7, 89};
193
+        int[] actual = testArraz.removeElementFromArray(arr2, 432);
194
+
195
+        Assert.assertArrayEquals(expected, actual);
196
+    }
197
+
198
+    @Test
199
+    public void testInsertArrayAt1(){
200
+        int[] expected = new int[]{5, 10, 17, 3, 29, 100};
201
+        int[] actual = testArraz.insertArrayAt(arr1, 2, 17);
202
+
203
+        Assert.assertArrayEquals(expected, actual);
204
+    }
205
+
206
+    @Test
207
+    public void testInsertArrayAt2(){
208
+        int[] expected =  new int[]{2, 7, 432, 89, 6};
209
+        int[] actual = testArraz.insertArrayAt(arr2, 4, 6);
210
+
211
+        Assert.assertArrayEquals(expected, actual);
212
+    }
213
+
214
+    @Test
215
+    public void testFindMaxMinOfArray1(){
216
+        Assert.assertEquals(maxMin.getMax(), testArraz.findMaxMinOfArray(arr1).getMax());
217
+    }
218
+
219
+    @Test
220
+    public void testFindMaxMinOfArray2(){
221
+        Assert.assertEquals(maxMin.getMin(), testArraz.findMaxMinOfArray(arr1).getMin());
222
+    }
223
+
224
+    @Test
225
+    public void testRemoveDupesFromArray1(){
226
+        Integer[] array1 = new Integer[]{1,3 ,4, 3, 7, 7, 10};
227
+        Integer[] expected = new Integer[]{1, 3, 4, 7, 10};
228
+        Integer[] actual = testArraz.removeDupesFromArray(array1);
229
+        System.out.println(Arrays.toString(actual));
230
+
231
+        Assert.assertArrayEquals(expected, actual);
232
+    }
233
+
234
+    @Test
235
+    public void testRemoveDupesFromArray2(){
236
+        Integer[] array1 = new Integer[]{5, 1, 5, 5, 5 ,5};
237
+        Integer[] expected = new Integer[]{5, 1};
238
+        Integer[] actual = testArraz.removeDupesFromArray(array1);
239
+        System.out.println(Arrays.toString(actual));
240
+
241
+        Assert.assertArrayEquals(expected, actual);
242
+    }
243
+
244
+    @Test
245
+    public void testFind2ndLargestFromArray1(){
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);
249
+
250
+        Assert.assertEquals(expected, actual, .01);
251
+    }
252
+
253
+    @Test
254
+    public void testFind2ndLargestFromArray2(){
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);
258
+
259
+        Assert.assertEquals(expected, actual, .01);
260
+    }
261
+
262
+    @Test
263
+    public void testMakeMeAnArrayListFromArray1(){
264
+        List<Integer> expected= new ArrayList<>();
265
+        expected.add(5);
266
+        expected.add(4);
267
+        expected.add(3);
268
+        Integer[] array = new Integer[]{5, 4, 3};
269
+        List<Integer> actual = testArraz.makeMeAnArrayListFromArray(array);
270
+
271
+        Assert.assertEquals(expected, actual);
272
+    }
273
+
274
+    @Test
275
+    public void testMakeMeAnArrayListFromArray2(){
276
+        List<Integer> expected = new ArrayList<>();
277
+        expected.add(100);
278
+        expected.add(37);
279
+        expected.add(10);
280
+        expected.add(67);
281
+        Integer[] array = new Integer[]{100, 37, 10, 67};
282
+        List<Integer> actual = testArraz.makeMeAnArrayListFromArray(array);
283
+
284
+        Assert.assertEquals(expected, actual);
285
+    }
286
+
287
+    @Test
288
+    public void testMakeMeAnArrayFromArrayList1(){
289
+        Integer[] expected = new Integer[]{10, 7, 23, 50};
290
+        List<Integer> list = new ArrayList<>();
291
+        list.add(10);
292
+        list.add(7);
293
+        list.add(23);
294
+        list.add(50);
295
+        Integer[] actual = testArraz.makeMeAnArrayFromArrayList(list);
296
+
297
+        Assert.assertArrayEquals(expected, actual);
298
+    }
299
+
300
+    @Test
301
+    public void testMakeMeAnArrayFromArrayList2(){
302
+        Integer[] expected = new Integer[]{43, 19, 99, 6};
303
+        List<Integer> list = new ArrayList<>();
304
+        list.add(43);
305
+        list.add(19);
306
+        list.add(99);
307
+        list.add(6);
308
+        Integer[] actual = testArraz.makeMeAnArrayFromArrayList(list);
309
+
310
+        Assert.assertArrayEquals(expected, actual);
311
+    }
312
+
313
+
314
+    @Test
315
+    public void testCheck2ArraysForEqual1(){
316
+        int[] expected = new int[]{5, 10, 3, 29, 100};
317
+        Assert.assertTrue(testArraz.check2ArraysForEqual(arr1, expected));
318
+    }
319
+
320
+    @Test
321
+    public void testCheck2ArraysForEqual2(){
322
+        int[] expected = new int[]{100, 900, 1, 32};
323
+        Assert.assertFalse(testArraz.check2ArraysForEqual(arr1, expected));
324
+    }
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
+    }
354
+
164 355
 }