Seth 6 년 전
부모
커밋
829f794f7d
3개의 변경된 파일229개의 추가작업 그리고 66개의 파일을 삭제
  1. 95
    57
      .idea/workspace.xml
  2. 32
    4
      arraz/src/main/java/Arraz.java
  3. 102
    5
      arraz/src/test/java/ArrazTest.java

+ 95
- 57
.idea/workspace.xml 파일 보기

22
       </usages-collector>
22
       </usages-collector>
23
       <usages-collector id="statistics.file.types.edit">
23
       <usages-collector id="statistics.file.types.edit">
24
         <counts>
24
         <counts>
25
-          <entry key="JAVA" value="11571" />
25
+          <entry key="JAVA" value="14150" />
26
           <entry key="XML" value="3" />
26
           <entry key="XML" value="3" />
27
         </counts>
27
         </counts>
28
       </usages-collector>
28
       </usages-collector>
29
       <usages-collector id="statistics.file.types.open">
29
       <usages-collector id="statistics.file.types.open">
30
         <counts>
30
         <counts>
31
           <entry key="CLASS" value="1" />
31
           <entry key="CLASS" value="1" />
32
-          <entry key="JAVA" value="5" />
32
+          <entry key="JAVA" value="6" />
33
           <entry key="XML" value="3" />
33
           <entry key="XML" value="3" />
34
         </counts>
34
         </counts>
35
       </usages-collector>
35
       </usages-collector>
40
       <file pinned="false" current-in-tab="false">
40
       <file pinned="false" current-in-tab="false">
41
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
41
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
42
           <provider selected="true" editor-type-id="text-editor">
42
           <provider selected="true" editor-type-id="text-editor">
43
-            <state relative-caret-position="556">
44
-              <caret line="170" column="21" selection-start-line="170" selection-start-column="21" selection-end-line="170" selection-end-column="21" />
43
+            <state relative-caret-position="300">
44
+              <caret line="198" column="41" selection-start-line="198" selection-start-column="41" selection-end-line="198" selection-end-column="41" />
45
               <folding>
45
               <folding>
46
                 <element signature="e#3440#3441#0" expanded="true" />
46
                 <element signature="e#3440#3441#0" expanded="true" />
47
                 <element signature="e#3482#3483#0" expanded="true" />
47
                 <element signature="e#3482#3483#0" expanded="true" />
49
                 <element signature="e#3603#3604#0" expanded="true" />
49
                 <element signature="e#3603#3604#0" expanded="true" />
50
                 <element signature="e#3677#3678#0" expanded="true" />
50
                 <element signature="e#3677#3678#0" expanded="true" />
51
                 <element signature="e#3714#3715#0" expanded="true" />
51
                 <element signature="e#3714#3715#0" expanded="true" />
52
+                <element signature="e#4954#4955#0" expanded="true" />
53
+                <element signature="e#4995#4996#0" expanded="true" />
54
+                <element signature="e#5042#5043#0" expanded="true" />
55
+                <element signature="e#5115#5116#0" expanded="true" />
56
+                <element signature="e#5173#5174#0" expanded="true" />
57
+                <element signature="e#5234#5235#0" expanded="true" />
58
+                <element signature="e#5305#5306#0" expanded="true" />
59
+                <element signature="e#5342#5343#0" expanded="true" />
52
               </folding>
60
               </folding>
53
             </state>
61
             </state>
54
           </provider>
62
           </provider>
57
       <file pinned="false" current-in-tab="true">
65
       <file pinned="false" current-in-tab="true">
58
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
66
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
59
           <provider selected="true" editor-type-id="text-editor">
67
           <provider selected="true" editor-type-id="text-editor">
60
-            <state relative-caret-position="533">
61
-              <caret line="363" column="63" selection-start-line="363" selection-start-column="63" selection-end-line="363" selection-end-column="63" />
68
+            <state relative-caret-position="300">
69
+              <caret line="462" column="5" lean-forward="true" selection-start-line="462" selection-start-column="5" selection-end-line="462" selection-end-column="5" />
62
               <folding>
70
               <folding>
63
                 <element signature="imports" expanded="true" />
71
                 <element signature="imports" expanded="true" />
64
               </folding>
72
               </folding>
105
   </component>
113
   </component>
106
   <component name="FindInProjectRecents">
114
   <component name="FindInProjectRecents">
107
     <findStrings>
115
     <findStrings>
116
+      <find>list</find>
117
+      <find>rev</find>
108
       <find>sort</find>
118
       <find>sort</find>
119
+      <find>rever</find>
109
     </findStrings>
120
     </findStrings>
110
   </component>
121
   </component>
111
   <component name="Git.Settings">
122
   <component name="Git.Settings">
219
     <property name="GO_FMT" value="false" />
230
     <property name="GO_FMT" value="false" />
220
     <property name="WebServerToolWindowFactoryState" value="false" />
231
     <property name="WebServerToolWindowFactoryState" value="false" />
221
     <property name="aspect.path.notification.shown" value="true" />
232
     <property name="aspect.path.notification.shown" value="true" />
222
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544206709239" />
233
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544219473137" />
223
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
234
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
224
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
235
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
225
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
236
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
249
       </list>
260
       </list>
250
     </option>
261
     </option>
251
   </component>
262
   </component>
252
-  <component name="RunManager" selected="JUnit.ArrazTest.testTheTotalOfTenIs302">
263
+  <component name="RunManager" selected="JUnit.ArrazTest.testInsertEndCopy1">
253
     <configuration default="true" type="Applet" factoryName="Applet">
264
     <configuration default="true" type="Applet" factoryName="Applet">
254
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
265
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
255
       <method v="2">
266
       <method v="2">
262
         <option name="Make" enabled="true" />
273
         <option name="Make" enabled="true" />
263
       </method>
274
       </method>
264
     </configuration>
275
     </configuration>
265
-    <configuration name="ArrazTest.testArrayHas65and772" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
276
+    <configuration name="ArrazTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
266
       <module name="arraz" />
277
       <module name="arraz" />
267
       <option name="PACKAGE_NAME" value="" />
278
       <option name="PACKAGE_NAME" value="" />
268
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
279
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
269
-      <option name="METHOD_NAME" value="testArrayHas65and772" />
270
-      <option name="TEST_OBJECT" value="method" />
271
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
280
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
272
       <method v="2">
281
       <method v="2">
273
         <option name="Make" enabled="true" />
282
         <option name="Make" enabled="true" />
274
       </method>
283
       </method>
275
     </configuration>
284
     </configuration>
276
-    <configuration name="ArrazTest.testFind2ndLargestFromArray1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
285
+    <configuration name="ArrazTest.testInsertEndCopy1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
277
       <module name="arraz" />
286
       <module name="arraz" />
278
       <option name="PACKAGE_NAME" value="" />
287
       <option name="PACKAGE_NAME" value="" />
279
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
288
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
280
-      <option name="METHOD_NAME" value="testFind2ndLargestFromArray1" />
289
+      <option name="METHOD_NAME" value="testInsertEndCopy1" />
281
       <option name="TEST_OBJECT" value="method" />
290
       <option name="TEST_OBJECT" value="method" />
282
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
291
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
283
       <method v="2">
292
       <method v="2">
284
         <option name="Make" enabled="true" />
293
         <option name="Make" enabled="true" />
285
       </method>
294
       </method>
286
     </configuration>
295
     </configuration>
287
-    <configuration name="ArrazTest.testFind2ndLargestFromArray2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
296
+    <configuration name="ArrazTest.testInsertEndCopy2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
288
       <module name="arraz" />
297
       <module name="arraz" />
289
       <option name="PACKAGE_NAME" value="" />
298
       <option name="PACKAGE_NAME" value="" />
290
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
299
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
291
-      <option name="METHOD_NAME" value="testFind2ndLargestFromArray2" />
300
+      <option name="METHOD_NAME" value="testInsertEndCopy2" />
292
       <option name="TEST_OBJECT" value="method" />
301
       <option name="TEST_OBJECT" value="method" />
293
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
302
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
294
       <method v="2">
303
       <method v="2">
295
         <option name="Make" enabled="true" />
304
         <option name="Make" enabled="true" />
296
       </method>
305
       </method>
297
     </configuration>
306
     </configuration>
298
-    <configuration name="ArrazTest.testTheTotalOfTenIs301" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
307
+    <configuration name="ArrazTest.testInsertStartCopy1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
299
       <module name="arraz" />
308
       <module name="arraz" />
300
       <option name="PACKAGE_NAME" value="" />
309
       <option name="PACKAGE_NAME" value="" />
301
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
310
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
302
-      <option name="METHOD_NAME" value="testTheTotalOfTenIs301" />
311
+      <option name="METHOD_NAME" value="testInsertStartCopy1" />
303
       <option name="TEST_OBJECT" value="method" />
312
       <option name="TEST_OBJECT" value="method" />
304
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
313
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
305
       <method v="2">
314
       <method v="2">
306
         <option name="Make" enabled="true" />
315
         <option name="Make" enabled="true" />
307
       </method>
316
       </method>
308
     </configuration>
317
     </configuration>
309
-    <configuration name="ArrazTest.testTheTotalOfTenIs302" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
318
+    <configuration name="ArrazTest.testInsertStartCopy2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
310
       <module name="arraz" />
319
       <module name="arraz" />
311
       <option name="PACKAGE_NAME" value="" />
320
       <option name="PACKAGE_NAME" value="" />
312
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
321
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
313
-      <option name="METHOD_NAME" value="testTheTotalOfTenIs302" />
322
+      <option name="METHOD_NAME" value="testInsertStartCopy2" />
314
       <option name="TEST_OBJECT" value="method" />
323
       <option name="TEST_OBJECT" value="method" />
315
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
324
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
316
       <method v="2">
325
       <method v="2">
341
       </method>
350
       </method>
342
     </configuration>
351
     </configuration>
343
     <list>
352
     <list>
344
-      <item itemvalue="JUnit.ArrazTest.testArrayHas65and772" />
345
-      <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray2" />
346
-      <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray1" />
347
-      <item itemvalue="JUnit.ArrazTest.testTheTotalOfTenIs301" />
348
-      <item itemvalue="JUnit.ArrazTest.testTheTotalOfTenIs302" />
353
+      <item itemvalue="JUnit.ArrazTest" />
354
+      <item itemvalue="JUnit.ArrazTest.testInsertStartCopy1" />
355
+      <item itemvalue="JUnit.ArrazTest.testInsertStartCopy2" />
356
+      <item itemvalue="JUnit.ArrazTest.testInsertEndCopy2" />
357
+      <item itemvalue="JUnit.ArrazTest.testInsertEndCopy1" />
349
     </list>
358
     </list>
350
     <recent_temporary>
359
     <recent_temporary>
351
       <list>
360
       <list>
352
-        <item itemvalue="JUnit.ArrazTest.testTheTotalOfTenIs302" />
353
-        <item itemvalue="JUnit.ArrazTest.testTheTotalOfTenIs301" />
354
-        <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray1" />
355
-        <item itemvalue="JUnit.ArrazTest.testFind2ndLargestFromArray2" />
356
-        <item itemvalue="JUnit.ArrazTest.testArrayHas65and772" />
361
+        <item itemvalue="JUnit.ArrazTest.testInsertEndCopy1" />
362
+        <item itemvalue="JUnit.ArrazTest.testInsertEndCopy2" />
363
+        <item itemvalue="JUnit.ArrazTest.testInsertStartCopy2" />
364
+        <item itemvalue="JUnit.ArrazTest.testInsertStartCopy1" />
365
+        <item itemvalue="JUnit.ArrazTest" />
357
       </list>
366
       </list>
358
     </recent_temporary>
367
     </recent_temporary>
359
   </component>
368
   </component>
370
       <workItem from="1543955862749" duration="2347000" />
379
       <workItem from="1543955862749" duration="2347000" />
371
       <workItem from="1543958998826" duration="113000" />
380
       <workItem from="1543958998826" duration="113000" />
372
       <workItem from="1544020724645" duration="762000" />
381
       <workItem from="1544020724645" duration="762000" />
373
-      <workItem from="1544046933389" duration="36119000" />
382
+      <workItem from="1544046933389" duration="44493000" />
374
     </task>
383
     </task>
375
     <task id="LOCAL-00001" summary="readme and docs">
384
     <task id="LOCAL-00001" summary="readme and docs">
376
       <created>1544021313039</created>
385
       <created>1544021313039</created>
383
     <servers />
392
     <servers />
384
   </component>
393
   </component>
385
   <component name="TestHistory">
394
   <component name="TestHistory">
386
-    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin2 - 2018.12.07 at 12h 43m 07s.xml">
387
-      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin2" configurationId="JUnit" />
388
-    </history-entry>
389
-    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin - 2018.12.07 at 12h 43m 51s.xml">
390
-      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin" configurationId="JUnit" />
395
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.07 at 16h 02m 54s.xml">
396
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
391
     </history-entry>
397
     </history-entry>
392
-    <history-entry file="ArrazTest_testAverageArrayWithoutMaxMin - 2018.12.07 at 12h 44m 05s.xml">
393
-      <configuration name="ArrazTest.testAverageArrayWithoutMaxMin" configurationId="JUnit" />
398
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.07 at 16h 03m 30s.xml">
399
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
394
     </history-entry>
400
     </history-entry>
395
-    <history-entry file="ArrazTest_test1SumValuesOfArray1 - 2018.12.07 at 12h 46m 13s.xml">
396
-      <configuration name="ArrazTest.test1SumValuesOfArray1" configurationId="JUnit" />
401
+    <history-entry file="ArrazTest_testInsertArrayAt1 - 2018.12.07 at 16h 03m 55s.xml">
402
+      <configuration name="ArrazTest.testInsertArrayAt1" configurationId="JUnit" />
397
     </history-entry>
403
     </history-entry>
398
-    <history-entry file="ArrazTest - 2018.12.07 at 12h 46m 18s.xml">
404
+    <history-entry file="ArrazTest - 2018.12.07 at 16h 05m 27s.xml">
399
       <configuration name="ArrazTest" configurationId="JUnit" />
405
       <configuration name="ArrazTest" configurationId="JUnit" />
400
     </history-entry>
406
     </history-entry>
401
-    <history-entry file="ArrazTest_testArrayHas65and771 - 2018.12.07 at 12h 51m 30s.xml">
402
-      <configuration name="ArrazTest.testArrayHas65and771" configurationId="JUnit" />
407
+    <history-entry file="ArrazTest_testInsertStartCopy1 - 2018.12.07 at 16h 31m 44s.xml">
408
+      <configuration name="ArrazTest.testInsertStartCopy1" configurationId="JUnit" />
409
+    </history-entry>
410
+    <history-entry file="ArrazTest_testInsertStartCopy2 - 2018.12.07 at 16h 31m 46s.xml">
411
+      <configuration name="ArrazTest.testInsertStartCopy2" configurationId="JUnit" />
403
     </history-entry>
412
     </history-entry>
404
-    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 12h 51m 33s.xml">
405
-      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
413
+    <history-entry file="ArrazTest_testInsertEndCopy2 - 2018.12.07 at 16h 45m 50s.xml">
414
+      <configuration name="ArrazTest.testInsertEndCopy2" configurationId="JUnit" />
406
     </history-entry>
415
     </history-entry>
407
-    <history-entry file="ArrazTest_testArrayHas65and772 - 2018.12.07 at 12h 52m 03s.xml">
408
-      <configuration name="ArrazTest.testArrayHas65and772" configurationId="JUnit" />
416
+    <history-entry file="ArrazTest_testInsertEndCopy2 - 2018.12.07 at 16h 46m 24s.xml">
417
+      <configuration name="ArrazTest.testInsertEndCopy2" configurationId="JUnit" />
409
     </history-entry>
418
     </history-entry>
410
-    <history-entry file="ArrazTest_testFind2ndLargestFromArray2 - 2018.12.07 at 13h 01m 28s.xml">
411
-      <configuration name="ArrazTest.testFind2ndLargestFromArray2" configurationId="JUnit" />
419
+    <history-entry file="ArrazTest_testInsertEndCopy2 - 2018.12.07 at 16h 46m 57s.xml">
420
+      <configuration name="ArrazTest.testInsertEndCopy2" configurationId="JUnit" />
412
     </history-entry>
421
     </history-entry>
413
-    <history-entry file="ArrazTest_testFind2ndLargestFromArray1 - 2018.12.07 at 13h 01m 31s.xml">
414
-      <configuration name="ArrazTest.testFind2ndLargestFromArray1" configurationId="JUnit" />
422
+    <history-entry file="ArrazTest_testInsertEndCopy2 - 2018.12.07 at 16h 47m 14s.xml">
423
+      <configuration name="ArrazTest.testInsertEndCopy2" configurationId="JUnit" />
415
     </history-entry>
424
     </history-entry>
416
   </component>
425
   </component>
417
   <component name="TimeTrackingManager">
426
   <component name="TimeTrackingManager">
418
-    <option name="totallyTimeSpent" value="39341000" />
427
+    <option name="totallyTimeSpent" value="47715000" />
419
   </component>
428
   </component>
420
   <component name="ToolWindowManager">
429
   <component name="ToolWindowManager">
421
     <frame x="1" y="23" width="1440" height="807" extended-state="0" />
430
     <frame x="1" y="23" width="1440" height="807" extended-state="0" />
422
     <editor active="true" />
431
     <editor active="true" />
423
     <layout>
432
     <layout>
424
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26108727" />
433
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26108727" />
425
       <window_info id="Structure" order="1" weight="0.25" />
434
       <window_info id="Structure" order="1" weight="0.25" />
426
       <window_info id="Image Layers" order="2" />
435
       <window_info id="Image Layers" order="2" />
427
       <window_info id="Designer" order="3" />
436
       <window_info id="Designer" order="3" />
432
       <window_info anchor="bottom" id="Messages" weight="0.32867134" />
441
       <window_info anchor="bottom" id="Messages" weight="0.32867134" />
433
       <window_info anchor="bottom" id="Message" order="0" />
442
       <window_info anchor="bottom" id="Message" order="0" />
434
       <window_info anchor="bottom" id="Find" order="1" />
443
       <window_info anchor="bottom" id="Find" order="1" />
435
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32867134" />
444
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32867134" />
436
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
445
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
437
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
446
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
438
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
447
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
491
     <MESSAGE value="readme and docs" />
500
     <MESSAGE value="readme and docs" />
492
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
501
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
493
   </component>
502
   </component>
503
+  <component name="XDebuggerManager">
504
+    <breakpoint-manager>
505
+      <breakpoints>
506
+        <line-breakpoint enabled="true" type="java-method">
507
+          <url>file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java</url>
508
+          <line>206</line>
509
+          <properties class="ArrazTest" method="testInsertArrayAt2">
510
+            <option name="EMULATED" value="true" />
511
+          </properties>
512
+          <option name="timeStamp" value="26" />
513
+        </line-breakpoint>
514
+      </breakpoints>
515
+    </breakpoint-manager>
516
+  </component>
494
   <component name="editorHistoryManager">
517
   <component name="editorHistoryManager">
495
     <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
518
     <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
496
       <provider selected="true" editor-type-id="text-editor">
519
       <provider selected="true" editor-type-id="text-editor">
530
         </state>
553
         </state>
531
       </provider>
554
       </provider>
532
     </entry>
555
     </entry>
556
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/src.zip!/java/util/ArrayList.java">
557
+      <provider selected="true" editor-type-id="text-editor">
558
+        <state relative-caret-position="-10766">
559
+          <caret line="106" column="13" selection-start-line="106" selection-start-column="13" selection-end-line="106" selection-end-column="13" />
560
+        </state>
561
+      </provider>
562
+    </entry>
533
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
563
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
534
       <provider selected="true" editor-type-id="text-editor">
564
       <provider selected="true" editor-type-id="text-editor">
535
         <state>
565
         <state>
555
     </entry>
585
     </entry>
556
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
586
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
557
       <provider selected="true" editor-type-id="text-editor">
587
       <provider selected="true" editor-type-id="text-editor">
558
-        <state relative-caret-position="556">
559
-          <caret line="170" column="21" selection-start-line="170" selection-start-column="21" selection-end-line="170" selection-end-column="21" />
588
+        <state relative-caret-position="300">
589
+          <caret line="198" column="41" selection-start-line="198" selection-start-column="41" selection-end-line="198" selection-end-column="41" />
560
           <folding>
590
           <folding>
561
             <element signature="e#3440#3441#0" expanded="true" />
591
             <element signature="e#3440#3441#0" expanded="true" />
562
             <element signature="e#3482#3483#0" expanded="true" />
592
             <element signature="e#3482#3483#0" expanded="true" />
564
             <element signature="e#3603#3604#0" expanded="true" />
594
             <element signature="e#3603#3604#0" expanded="true" />
565
             <element signature="e#3677#3678#0" expanded="true" />
595
             <element signature="e#3677#3678#0" expanded="true" />
566
             <element signature="e#3714#3715#0" expanded="true" />
596
             <element signature="e#3714#3715#0" expanded="true" />
597
+            <element signature="e#4954#4955#0" expanded="true" />
598
+            <element signature="e#4995#4996#0" expanded="true" />
599
+            <element signature="e#5042#5043#0" expanded="true" />
600
+            <element signature="e#5115#5116#0" expanded="true" />
601
+            <element signature="e#5173#5174#0" expanded="true" />
602
+            <element signature="e#5234#5235#0" expanded="true" />
603
+            <element signature="e#5305#5306#0" expanded="true" />
604
+            <element signature="e#5342#5343#0" expanded="true" />
567
           </folding>
605
           </folding>
568
         </state>
606
         </state>
569
       </provider>
607
       </provider>
570
     </entry>
608
     </entry>
571
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
609
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
572
       <provider selected="true" editor-type-id="text-editor">
610
       <provider selected="true" editor-type-id="text-editor">
573
-        <state relative-caret-position="533">
574
-          <caret line="363" column="63" selection-start-line="363" selection-start-column="63" selection-end-line="363" selection-end-column="63" />
611
+        <state relative-caret-position="300">
612
+          <caret line="462" column="5" lean-forward="true" selection-start-line="462" selection-start-column="5" selection-end-line="462" selection-end-column="5" />
575
           <folding>
613
           <folding>
576
             <element signature="imports" expanded="true" />
614
             <element signature="imports" expanded="true" />
577
           </folding>
615
           </folding>

+ 32
- 4
arraz/src/main/java/Arraz.java 파일 보기

104
     public int[] insertArrayAt(int[] array, int index, int value){
104
     public int[] insertArrayAt(int[] array, int index, int value){
105
         int[] newArray = new int[array.length + 1];
105
         int[] newArray = new int[array.length + 1];
106
         int counter = 0;
106
         int counter = 0;
107
-        for (int i = 0; i < array.length-1; i++) {
108
-            if (i == index){
109
-                newArray[index] = value;
107
+        for (int i = 0; i < array.length; i++) {
108
+            if (counter == index){
109
+                newArray[counter] = value;
110
                 counter++;
110
                 counter++;
111
-            }else {
111
+                i--;
112
+            }else{
112
                 newArray[counter] = array[i];
113
                 newArray[counter] = array[i];
113
                 counter++;
114
                 counter++;
114
             }
115
             }
170
         }
171
         }
171
         return false;
172
         return false;
172
     }
173
     }
174
+
175
+    public Integer[] min2Array(Integer[] array){
176
+        Set<Integer> minSet = new TreeSet<>(Arrays.asList(array));
177
+        return Arrays.copyOfRange(minSet.toArray(new Integer[0]), 0, 2);
178
+    }
179
+
180
+    public int[] reverseCopy(int[] array){
181
+       return reverseArray(array);
182
+    }
183
+
184
+    public int[] removeLastItemCopy(int[] array){
185
+        return removeElementFromArray(array, array[array.length-1]);
186
+    }
187
+
188
+    public int[] removeFirstItemCopy(int[] array){
189
+        return removeElementFromArray(array, array[0]);
190
+    }
191
+
192
+    public int[] insertStartCopy(int[] array, int value){
193
+        return insertArrayAt(array, 0, value);
194
+    }
195
+
196
+    public Integer[] insertEndCopy(Integer[] array, int value){
197
+        List<Integer> list = new ArrayList<>(Arrays.asList(array));
198
+        list.add(value);
199
+        return list.toArray(new Integer[0]);
200
+    }
173
 }
201
 }

+ 102
- 5
arraz/src/test/java/ArrazTest.java 파일 보기

3
 import org.junit.Assert;
3
 import org.junit.Assert;
4
 import org.junit.Before;
4
 import org.junit.Before;
5
 import org.junit.Test;
5
 import org.junit.Test;
6
-
7
 import java.util.ArrayList;
6
 import java.util.ArrayList;
8
 import java.util.Arrays;
7
 import java.util.Arrays;
9
 import java.util.List;
8
 import java.util.List;
197
 
196
 
198
     @Test
197
     @Test
199
     public void testInsertArrayAt1(){
198
     public void testInsertArrayAt1(){
200
-        int[] expected = new int[]{5, 10, 17, 3, 29, 100};
201
-        int[] actual = testArraz.insertArrayAt(arr1, 2, 17);
199
+        int[] expected = new int[]{5, 10, 3, 17, 29, 100};
200
+        int[] actual = testArraz.insertArrayAt(arr1, 3, 17);
201
+        System.out.println(Arrays.toString(actual));
202
 
202
 
203
         Assert.assertArrayEquals(expected, actual);
203
         Assert.assertArrayEquals(expected, actual);
204
     }
204
     }
205
 
205
 
206
     @Test
206
     @Test
207
     public void testInsertArrayAt2(){
207
     public void testInsertArrayAt2(){
208
-        int[] expected =  new int[]{2, 7, 432, 89, 6};
209
-        int[] actual = testArraz.insertArrayAt(arr2, 4, 6);
208
+        int[] expected =  new int[]{2, 6, 7, 432, 89};
209
+        int[] actual = testArraz.insertArrayAt(arr2, 1, 6);
210
+        System.out.println(Arrays.toString(actual));
210
 
211
 
211
         Assert.assertArrayEquals(expected, actual);
212
         Assert.assertArrayEquals(expected, actual);
212
     }
213
     }
364
         Assert.assertFalse(testArraz.theTotalOfTenIs30(array));
365
         Assert.assertFalse(testArraz.theTotalOfTenIs30(array));
365
     }
366
     }
366
 
367
 
368
+    @Test
369
+    public void testMin2Array1(){
370
+        Integer[] expected = new Integer[]{3, 5};
371
+        Integer[] actual = testArraz.min2Array(new Integer[]{100, 54, 10, 78, 10, 5, 3});
372
+
373
+        Assert.assertArrayEquals(expected, actual);
374
+    }
375
+
376
+    @Test
377
+    public void testMin2Array(){
378
+        Integer[] expected = new Integer[]{1, 10};
379
+        Integer[] actual = testArraz.min2Array(new Integer[]{1,1,1,1,10});
380
+
381
+        Assert.assertArrayEquals(expected, actual);
382
+    }
383
+
384
+    @Test
385
+    public void testReverseCopy1(){
386
+        int[] expected = new int[]{100, 29, 3, 10, 5};
387
+        int[] actual = testArraz.reverseCopy(arr1);
388
+
389
+        Assert.assertArrayEquals(expected,actual);
390
+    }
391
+
392
+    @Test
393
+    public void testReverseCopy2(){
394
+        int[] expected = new int[]{89, 432, 7, 2};
395
+        int[] actual = testArraz.reverseCopy(arr2);
396
+
397
+        Assert.assertArrayEquals(expected, actual);
398
+    }
399
+
400
+    @Test
401
+    public void testRemoveLastItemCopy1(){
402
+        int[] expected = new int[]{5, 10, 3, 29};
403
+        int[] actual = testArraz.removeLastItemCopy(arr1);
404
+
405
+        Assert.assertArrayEquals(expected, actual);
406
+    }
407
+
408
+    @Test
409
+    public void testRemoveLastItemCopy2(){
410
+        int[] expected =  new int[]{2, 7, 432};
411
+        int[] actual = testArraz.removeLastItemCopy(arr2);
412
+
413
+        Assert.assertArrayEquals(expected, actual);
414
+    }
415
+
416
+    @Test
417
+    public void testRemoveFirstItemCopy1(){
418
+        int[] expected = new int[]{7, 432, 89};
419
+        int[] actual = testArraz.removeFirstItemCopy(arr2);
420
+
421
+        Assert.assertArrayEquals(expected, actual);
422
+    }
423
+
424
+    @Test
425
+    public void testRemoveFirstItemCopy2(){
426
+        int[] expected = new int[]{10, 3, 29, 100};
427
+        int[] actual = testArraz.removeFirstItemCopy(arr1);
428
+
429
+        Assert.assertArrayEquals(expected, actual);
430
+    }
431
+
432
+    @Test
433
+    public void testInsertStartCopy1(){
434
+        int[] expected = new int[]{4, 5, 10, 3, 29, 100};
435
+        int[] actual = testArraz.insertStartCopy(arr1, 4);
436
+
437
+        Assert.assertArrayEquals(expected, actual);
438
+    }
439
+
440
+    @Test
441
+    public void testInsertStartCopy2(){
442
+        int[] expected = new int[]{56, 2, 7, 432, 89};
443
+        int[] actual = testArraz.insertStartCopy(arr2, 56);
444
+
445
+        Assert.assertArrayEquals(expected, actual);
446
+    }
447
+
448
+    @Test
449
+    public void testInsertEndCopy1(){
450
+        Integer[] expected = new Integer[]{2, 7, 432, 89, 9};
451
+        Integer[] actual = testArraz.insertEndCopy(new Integer[]{2, 7, 432, 89}, 9);
452
+
453
+        Assert.assertArrayEquals(expected, actual);
454
+    }
455
+
456
+    @Test
457
+    public void testInsertEndCopy2(){
458
+        Integer[] expected = new Integer[]{5, 10, 3, 29, 100, 90};
459
+        Integer[] actual = testArraz.insertEndCopy(new Integer[]{5, 10, 3, 29, 100}, 90);
460
+        System.out.println(Arrays.toString(actual));
461
+
462
+        Assert.assertArrayEquals(expected, actual);
463
+    }
367
 }
464
 }