浏览代码

up to dupes

mpierse 6 年前
父节点
当前提交
d496c948fc
共有 5 个文件被更改,包括 702 次插入251 次删除
  1. 351
    251
      .idea/workspace.xml
  2. 121
    0
      arraz/src/main/java/Arraz.java
  3. 18
    0
      arraz/src/main/java/MinMax.java
  4. 23
    0
      arraz/src/main/java/OddEven.java
  5. 189
    0
      arraz/src/test/java/ArrazTest.java

+ 351
- 251
.idea/workspace.xml 查看文件

@@ -2,69 +2,154 @@
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" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
6
-      <change beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
5
+      <change afterPath="$PROJECT_DIR$/arraz/src/main/java/MinMax.java" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
7 10
     </list>
8 11
     <ignored path="$PROJECT_DIR$/arraz/target/" />
9 12
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
10
-    <option name="TRACKING_ENABLED" value="true" />
11 13
     <option name="SHOW_DIALOG" value="false" />
12 14
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
13 15
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14 16
     <option name="LAST_RESOLUTION" value="IGNORE" />
15 17
   </component>
18
+  <component name="FUSProjectUsageTrigger">
19
+    <session id="-1999203066">
20
+      <usages-collector id="statistics.lifecycle.project">
21
+        <counts>
22
+          <entry key="project.open.time.1" value="1" />
23
+          <entry key="project.opened" value="1" />
24
+        </counts>
25
+      </usages-collector>
26
+      <usages-collector id="statistics.file.extensions.open">
27
+        <counts>
28
+          <entry key="java" value="2" />
29
+          <entry key="md" value="1" />
30
+        </counts>
31
+      </usages-collector>
32
+      <usages-collector id="statistics.file.types.open">
33
+        <counts>
34
+          <entry key="JAVA" value="2" />
35
+          <entry key="Markdown" value="1" />
36
+        </counts>
37
+      </usages-collector>
38
+      <usages-collector id="statistics.file.extensions.edit">
39
+        <counts>
40
+          <entry key="java" value="3481" />
41
+        </counts>
42
+      </usages-collector>
43
+      <usages-collector id="statistics.file.types.edit">
44
+        <counts>
45
+          <entry key="JAVA" value="3481" />
46
+        </counts>
47
+      </usages-collector>
48
+    </session>
49
+  </component>
16 50
   <component name="FileEditorManager">
17
-    <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
18
-      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
19
-        <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
20
-          <provider selected="true" editor-type-id="text-editor">
21
-            <state relative-caret-position="0">
22
-              <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
23
-              <folding />
24
-            </state>
25
-          </provider>
26
-        </entry>
27
-      </file>
28
-      <file leaf-file-name="Arraz.java" pinned="false" current-in-tab="false">
29
-        <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
30
-          <provider selected="true" editor-type-id="text-editor">
31
-            <state relative-caret-position="0">
32
-              <caret line="0" column="15" lean-forward="false" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
33
-              <folding />
34
-            </state>
35
-          </provider>
36
-        </entry>
37
-      </file>
38
-      <file leaf-file-name="ArrazTest.java" pinned="false" current-in-tab="false">
39
-        <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
40
-          <provider selected="true" editor-type-id="text-editor">
41
-            <state relative-caret-position="34">
42
-              <caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
43
-              <folding />
44
-            </state>
45
-          </provider>
46
-        </entry>
47
-      </file>
48
-      <file leaf-file-name="README.md" pinned="false" current-in-tab="true">
49
-        <entry file="file://$PROJECT_DIR$/README.md">
50
-          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
51
-            <state split_layout="SPLIT">
52
-              <first_editor relative-caret-position="306">
53
-                <caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
54
-                <folding />
55
-              </first_editor>
56
-              <second_editor />
57
-            </state>
58
-          </provider>
59
-        </entry>
60
-      </file>
61
-    </leaf>
51
+    <splitter split-orientation="horizontal" split-proportion="0.5">
52
+      <split-first>
53
+        <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
54
+          <file pinned="false" current-in-tab="false">
55
+            <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
56
+              <provider selected="true" editor-type-id="text-editor" />
57
+            </entry>
58
+          </file>
59
+          <file pinned="false" current-in-tab="false">
60
+            <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
61
+              <provider selected="true" editor-type-id="text-editor">
62
+                <state relative-caret-position="369">
63
+                  <caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
64
+                  <folding>
65
+                    <element signature="imports" expanded="true" />
66
+                    <element signature="e#414#415#0" expanded="true" />
67
+                    <element signature="e#448#449#0" expanded="true" />
68
+                    <element signature="e#535#536#0" expanded="true" />
69
+                    <element signature="e#576#577#0" expanded="true" />
70
+                    <element signature="e#2864#2873#0" expanded="true" />
71
+                    <element signature="e#2895#2904#0" expanded="true" />
72
+                  </folding>
73
+                </state>
74
+              </provider>
75
+            </entry>
76
+          </file>
77
+          <file pinned="false" current-in-tab="true">
78
+            <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
79
+              <provider selected="true" editor-type-id="text-editor">
80
+                <state relative-caret-position="372">
81
+                  <caret line="191" column="40" selection-start-line="191" selection-start-column="40" selection-end-line="191" selection-end-column="40" />
82
+                  <folding>
83
+                    <element signature="imports" expanded="true" />
84
+                    <element signature="e#1970#1971#0" expanded="true" />
85
+                    <element signature="e#1991#1992#0" expanded="true" />
86
+                    <element signature="e#2102#2103#0" expanded="true" />
87
+                    <element signature="e#2181#2182#0" expanded="true" />
88
+                    <element signature="e#3139#3140#0" expanded="true" />
89
+                    <element signature="e#3196#3197#0" expanded="true" />
90
+                    <element signature="e#3267#3268#0" expanded="true" />
91
+                    <element signature="e#3348#3349#0" expanded="true" />
92
+                    <element signature="e#5073#5074#0" expanded="true" />
93
+                    <element signature="e#5149#5150#0" expanded="true" />
94
+                  </folding>
95
+                </state>
96
+              </provider>
97
+            </entry>
98
+          </file>
99
+          <file pinned="false" current-in-tab="false">
100
+            <entry file="file://$PROJECT_DIR$/arraz/src/main/java/MinMax.java">
101
+              <provider selected="true" editor-type-id="text-editor">
102
+                <state relative-caret-position="150">
103
+                  <caret line="10" column="25" selection-start-line="10" selection-start-column="25" selection-end-line="10" selection-end-column="25" />
104
+                  <folding>
105
+                    <element signature="e#211#212#0" expanded="true" />
106
+                    <element signature="e#238#239#0" expanded="true" />
107
+                    <element signature="e#264#265#0" expanded="true" />
108
+                  </folding>
109
+                </state>
110
+              </provider>
111
+            </entry>
112
+          </file>
113
+          <file pinned="false" current-in-tab="false">
114
+            <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
115
+              <provider selected="true" editor-type-id="text-editor">
116
+                <state relative-caret-position="255">
117
+                  <caret line="17" selection-start-line="17" selection-end-line="17" />
118
+                  <folding>
119
+                    <element signature="e#200#201#0" expanded="true" />
120
+                    <element signature="e#227#228#0" expanded="true" />
121
+                    <element signature="e#256#257#0" expanded="true" />
122
+                    <element signature="e#284#285#0" expanded="true" />
123
+                  </folding>
124
+                </state>
125
+              </provider>
126
+            </entry>
127
+          </file>
128
+        </leaf>
129
+      </split-first>
130
+      <split-second>
131
+        <leaf>
132
+          <file pinned="false" current-in-tab="true">
133
+            <entry file="file://$PROJECT_DIR$/README.md">
134
+              <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
135
+                <state split_layout="SECOND">
136
+                  <first_editor>
137
+                    <caret line="18" selection-start-line="18" selection-end-line="18" />
138
+                  </first_editor>
139
+                  <second_editor />
140
+                </state>
141
+              </provider>
142
+            </entry>
143
+          </file>
144
+        </leaf>
145
+      </split-second>
146
+    </splitter>
62 147
   </component>
63 148
   <component name="FileTemplateManagerImpl">
64 149
     <option name="RECENT_TEMPLATES">
65 150
       <list>
66
-        <option value="Class" />
67 151
         <option value="JUnit4 Test Class" />
152
+        <option value="Class" />
68 153
       </list>
69 154
     </option>
70 155
   </component>
@@ -72,9 +157,6 @@
72 157
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
73 158
   </component>
74 159
   <component name="GradleLocalSettings">
75
-    <option name="externalProjectsViewState">
76
-      <projects_view />
77
-    </option>
78 160
     <option name="projectSyncType">
79 161
       <map>
80 162
         <entry key="$USER_HOME$/GitHub/gs-gradle/initial" value="PREVIEW" />
@@ -84,8 +166,11 @@
84 166
   <component name="IdeDocumentHistory">
85 167
     <option name="CHANGED_PATHS">
86 168
       <list>
87
-        <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
88 169
         <option value="$PROJECT_DIR$/README.md" />
170
+        <option value="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" />
171
+        <option value="$PROJECT_DIR$/arraz/src/main/java/MinMax.java" />
172
+        <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
173
+        <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
89 174
       </list>
90 175
     </option>
91 176
   </component>
@@ -102,24 +187,14 @@
102 187
       </MavenImportingSettings>
103 188
     </option>
104 189
   </component>
105
-  <component name="ProjectFrameBounds">
106
-    <option name="x" value="242" />
107
-    <option name="y" value="45" />
108
-    <option name="width" value="1538" />
109
-    <option name="height" value="962" />
190
+  <component name="ProjectFrameBounds" extendedState="6">
191
+    <option name="x" value="118" />
192
+    <option name="y" value="23" />
193
+    <option name="width" value="1175" />
194
+    <option name="height" value="797" />
110 195
   </component>
111 196
   <component name="ProjectView">
112
-    <navigator currentView="ProjectPane" proportions="" version="1">
113
-      <flattenPackages />
114
-      <showMembers />
115
-      <showModules />
116
-      <showLibraryContents />
117
-      <hideEmptyPackages />
118
-      <abbreviatePackageNames />
119
-      <autoscrollToSource />
120
-      <autoscrollFromSource />
121
-      <sortByType />
122
-      <manualOrder />
197
+    <navigator proportions="" version="1">
123 198
       <foldersAlwaysOnTop value="true" />
124 199
     </navigator>
125 200
     <panes>
@@ -157,21 +232,20 @@
157 232
           <select />
158 233
         </subPane>
159 234
       </pane>
160
-      <pane id="Scratches" />
161
-      <pane id="PackagesPane" />
162
-      <pane id="AndroidView" />
163 235
       <pane id="Scope" />
236
+      <pane id="PackagesPane" />
164 237
     </panes>
165 238
   </component>
166 239
   <component name="PropertiesComponent">
167
-    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
168
-    <property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
240
+    <property name="GO_FMT" value="false" />
169 241
     <property name="WebServerToolWindowFactoryState" value="false" />
170 242
     <property name="aspect.path.notification.shown" value="true" />
171
-    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
172
-    <property name="jdk.selected.JAVA_MODULE" value="1.8" />
243
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544141205829" />
173 244
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
174
-    <property name="GO_FMT" value="false" />
245
+    <property name="jdk.selected.JAVA_MODULE" value="1.8" />
246
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
247
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
248
+    <property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
175 249
   </component>
176 250
   <component name="RecentsManager">
177 251
     <key name="CreateTestDialog.RecentsKey">
@@ -180,6 +254,9 @@
180 254
     <key name="CreateTestDialog.Recents.Supers">
181 255
       <recent name="" />
182 256
     </key>
257
+    <key name="CreateClassDialog.RecentsKey">
258
+      <recent name="" />
259
+    </key>
183 260
   </component>
184 261
   <component name="RunDashboard">
185 262
     <option name="ruleStates">
@@ -193,90 +270,113 @@
193 270
       </list>
194 271
     </option>
195 272
   </component>
196
-  <component name="RunManager">
273
+  <component name="RunManager" selected="JUnit.ArrazTest.test1RemoveDupes">
197 274
     <configuration default="true" type="Applet" factoryName="Applet">
198
-      <option name="WIDTH" value="400" />
199
-      <option name="HEIGHT" value="300" />
200 275
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
201
-      <module />
276
+      <method v="2">
277
+        <option name="Make" enabled="true" />
278
+      </method>
202 279
     </configuration>
203 280
     <configuration default="true" type="Application" factoryName="Application">
204
-      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
205
-      <option name="MAIN_CLASS_NAME" />
206
-      <option name="VM_PARAMETERS" />
207
-      <option name="PROGRAM_PARAMETERS" />
208 281
       <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
209
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
210
-      <option name="ALTERNATIVE_JRE_PATH" />
211
-      <option name="ENABLE_SWING_INSPECTOR" value="false" />
212
-      <option name="ENV_VARIABLES" />
213
-      <option name="PASS_PARENT_ENVS" value="true" />
214
-      <module name="" />
215
-      <envs />
282
+      <method v="2">
283
+        <option name="Make" enabled="true" />
284
+      </method>
216 285
     </configuration>
217
-    <configuration default="true" type="JUnit" factoryName="JUnit">
218
-      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
219
-      <module name="" />
220
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
221
-      <option name="ALTERNATIVE_JRE_PATH" />
222
-      <option name="PACKAGE_NAME" />
223
-      <option name="MAIN_CLASS_NAME" />
224
-      <option name="METHOD_NAME" />
225
-      <option name="TEST_OBJECT" value="class" />
226
-      <option name="VM_PARAMETERS" value="-ea" />
227
-      <option name="PARAMETERS" />
286
+    <configuration name="ArrazTest.test1FindMinMax" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
287
+      <module name="arraz" />
288
+      <option name="PACKAGE_NAME" value="" />
289
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
290
+      <option name="METHOD_NAME" value="test1FindMinMax" />
291
+      <option name="TEST_OBJECT" value="method" />
292
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
293
+      <method v="2">
294
+        <option name="Make" enabled="true" />
295
+      </method>
296
+    </configuration>
297
+    <configuration name="ArrazTest.test1RemoveDupes" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
298
+      <module name="arraz" />
299
+      <option name="PACKAGE_NAME" value="" />
300
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
301
+      <option name="METHOD_NAME" value="test1RemoveDupes" />
302
+      <option name="TEST_OBJECT" value="method" />
303
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
304
+      <method v="2">
305
+        <option name="Make" enabled="true" />
306
+      </method>
307
+    </configuration>
308
+    <configuration name="ArrazTest.test2FindMinMax" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
309
+      <module name="arraz" />
310
+      <option name="PACKAGE_NAME" value="" />
311
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
312
+      <option name="METHOD_NAME" value="test2FindMinMax" />
313
+      <option name="TEST_OBJECT" value="method" />
314
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
315
+      <method v="2">
316
+        <option name="Make" enabled="true" />
317
+      </method>
318
+    </configuration>
319
+    <configuration name="ArrazTest.test2InsertIntoArrayAt" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
320
+      <module name="arraz" />
321
+      <option name="PACKAGE_NAME" value="" />
322
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
323
+      <option name="METHOD_NAME" value="test2InsertIntoArrayAt" />
324
+      <option name="TEST_OBJECT" value="method" />
228 325
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
229
-      <option name="ENV_VARIABLES" />
230
-      <option name="PASS_PARENT_ENVS" value="true" />
231
-      <option name="TEST_SEARCH_SCOPE">
232
-        <value defaultName="singleModule" />
233
-      </option>
234
-      <envs />
235
-      <patterns />
326
+      <method v="2">
327
+        <option name="Make" enabled="true" />
328
+      </method>
236 329
     </configuration>
237
-    <configuration default="true" type="Remote" factoryName="Remote">
238
-      <option name="USE_SOCKET_TRANSPORT" value="true" />
239
-      <option name="SERVER_MODE" value="false" />
240
-      <option name="SHMEM_ADDRESS" value="javadebug" />
241
-      <option name="HOST" value="localhost" />
242
-      <option name="PORT" value="5005" />
330
+    <configuration name="ArrazTest.test2RemoveDupes" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
331
+      <module name="arraz" />
332
+      <option name="PACKAGE_NAME" value="" />
333
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
334
+      <option name="METHOD_NAME" value="test2RemoveDupes" />
335
+      <option name="TEST_OBJECT" value="method" />
336
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
337
+      <method v="2">
338
+        <option name="Make" enabled="true" />
339
+      </method>
340
+    </configuration>
341
+    <configuration default="true" type="JUnit" factoryName="JUnit">
342
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
343
+      <method v="2">
344
+        <option name="Make" enabled="true" />
345
+      </method>
243 346
     </configuration>
244 347
     <configuration default="true" type="TestNG" factoryName="TestNG">
245
-      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
246
-      <module name="" />
247
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
248
-      <option name="ALTERNATIVE_JRE_PATH" />
249
-      <option name="SUITE_NAME" />
250
-      <option name="PACKAGE_NAME" />
251
-      <option name="MAIN_CLASS_NAME" />
252
-      <option name="METHOD_NAME" />
253
-      <option name="GROUP_NAME" />
254
-      <option name="TEST_OBJECT" value="CLASS" />
255
-      <option name="VM_PARAMETERS" value="-ea" />
256
-      <option name="PARAMETERS" />
257 348
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
258
-      <option name="OUTPUT_DIRECTORY" />
259
-      <option name="ANNOTATION_TYPE" />
260
-      <option name="ENV_VARIABLES" />
261
-      <option name="PASS_PARENT_ENVS" value="true" />
262
-      <option name="TEST_SEARCH_SCOPE">
263
-        <value defaultName="singleModule" />
264
-      </option>
265
-      <option name="USE_DEFAULT_REPORTERS" value="false" />
266
-      <option name="PROPERTIES_FILE" />
267
-      <envs />
268 349
       <properties />
269 350
       <listeners />
351
+      <method v="2">
352
+        <option name="Make" enabled="true" />
353
+      </method>
270 354
     </configuration>
271 355
     <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
272 356
       <module name="" />
273 357
       <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
274 358
       <option name="PROGRAM_PARAMETERS" />
275 359
       <predefined_log_file id="idea.log" enabled="true" />
360
+      <method v="2">
361
+        <option name="Make" enabled="true" />
362
+      </method>
276 363
     </configuration>
277
-  </component>
278
-  <component name="ShelveChangesManager" show_recycled="false">
279
-    <option name="remove_strategy" value="false" />
364
+    <list>
365
+      <item itemvalue="JUnit.ArrazTest.test2InsertIntoArrayAt" />
366
+      <item itemvalue="JUnit.ArrazTest.test1FindMinMax" />
367
+      <item itemvalue="JUnit.ArrazTest.test2FindMinMax" />
368
+      <item itemvalue="JUnit.ArrazTest.test1RemoveDupes" />
369
+      <item itemvalue="JUnit.ArrazTest.test2RemoveDupes" />
370
+    </list>
371
+    <recent_temporary>
372
+      <list>
373
+        <item itemvalue="JUnit.ArrazTest.test1RemoveDupes" />
374
+        <item itemvalue="JUnit.ArrazTest.test2RemoveDupes" />
375
+        <item itemvalue="JUnit.ArrazTest.test2FindMinMax" />
376
+        <item itemvalue="JUnit.ArrazTest.test1FindMinMax" />
377
+        <item itemvalue="JUnit.ArrazTest.test2InsertIntoArrayAt" />
378
+      </list>
379
+    </recent_temporary>
280 380
   </component>
281 381
   <component name="SvnConfiguration">
282 382
     <configuration />
@@ -291,6 +391,7 @@
291 391
       <workItem from="1543955862749" duration="2347000" />
292 392
       <workItem from="1543958998826" duration="113000" />
293 393
       <workItem from="1544020724645" duration="762000" />
394
+      <workItem from="1544046527795" duration="13055000" />
294 395
     </task>
295 396
     <task id="LOCAL-00001" summary="readme and docs">
296 397
       <created>1544021313039</created>
@@ -302,39 +403,73 @@
302 403
     <option name="localTasksCounter" value="2" />
303 404
     <servers />
304 405
   </component>
406
+  <component name="TestHistory">
407
+    <history-entry file="ArrazTest_test1RemoveElement - 2018.12.06 at 17h 55m 05s.xml">
408
+      <configuration name="ArrazTest.test1RemoveElement" configurationId="JUnit" />
409
+    </history-entry>
410
+    <history-entry file="ArrazTest_test1RemoveElement - 2018.12.06 at 17h 55m 18s.xml">
411
+      <configuration name="ArrazTest.test1RemoveElement" configurationId="JUnit" />
412
+    </history-entry>
413
+    <history-entry file="ArrazTest_test2RemoveElement - 2018.12.06 at 17h 55m 21s.xml">
414
+      <configuration name="ArrazTest.test2RemoveElement" configurationId="JUnit" />
415
+    </history-entry>
416
+    <history-entry file="ArrazTest_test1InsertIntoArrayAt - 2018.12.06 at 18h 23m 24s.xml">
417
+      <configuration name="ArrazTest.test1InsertIntoArrayAt" configurationId="JUnit" />
418
+    </history-entry>
419
+    <history-entry file="ArrazTest_test2InsertIntoArrayAt - 2018.12.06 at 18h 23m 30s.xml">
420
+      <configuration name="ArrazTest.test2InsertIntoArrayAt" configurationId="JUnit" />
421
+    </history-entry>
422
+    <history-entry file="ArrazTest_test2InsertIntoArrayAt - 2018.12.06 at 18h 23m 40s.xml">
423
+      <configuration name="ArrazTest.test2InsertIntoArrayAt" configurationId="JUnit" />
424
+    </history-entry>
425
+    <history-entry file="ArrazTest_test2InsertIntoArrayAt - 2018.12.06 at 18h 23m 47s.xml">
426
+      <configuration name="ArrazTest.test2InsertIntoArrayAt" configurationId="JUnit" />
427
+    </history-entry>
428
+    <history-entry file="ArrazTest_test1FindMinMax - 2018.12.06 at 18h 43m 10s.xml">
429
+      <configuration name="ArrazTest.test1FindMinMax" configurationId="JUnit" />
430
+    </history-entry>
431
+    <history-entry file="ArrazTest_test1FindMinMax - 2018.12.06 at 18h 43m 43s.xml">
432
+      <configuration name="ArrazTest.test1FindMinMax" configurationId="JUnit" />
433
+    </history-entry>
434
+    <history-entry file="ArrazTest_test2FindMinMax - 2018.12.06 at 18h 43m 45s.xml">
435
+      <configuration name="ArrazTest.test2FindMinMax" configurationId="JUnit" />
436
+    </history-entry>
437
+  </component>
305 438
   <component name="TimeTrackingManager">
306
-    <option name="totallyTimeSpent" value="3222000" />
439
+    <option name="totallyTimeSpent" value="16277000" />
307 440
   </component>
308 441
   <component name="ToolWindowManager">
309
-    <frame x="242" y="45" width="1538" height="962" extended-state="0" />
442
+    <frame x="0" y="23" width="1440" height="805" extended-state="6" />
310 443
     <editor active="true" />
311 444
     <layout>
312
-      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
313
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
314
-      <window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
315
-      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
316
-      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
317
-      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
318
-      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
319
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
320
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
321
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
322
-      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
323
-      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
324
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2577389" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
325
-      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
326
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
327
-      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
328
-      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
329
-      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
330
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
331
-      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
332
-      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
333
-      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
334
-      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
335
-      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
336
-      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
337
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
445
+      <window_info content_ui="combo" id="Project" order="0" weight="0.26108727" />
446
+      <window_info id="Structure" order="1" weight="0.25" />
447
+      <window_info id="Image Layers" order="2" />
448
+      <window_info id="Designer" order="3" />
449
+      <window_info id="UI Designer" order="4" />
450
+      <window_info id="Capture Tool" order="5" />
451
+      <window_info id="Favorites" order="6" side_tool="true" />
452
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
453
+      <window_info anchor="bottom" id="Messages" weight="0.32819074" />
454
+      <window_info anchor="bottom" id="Message" order="0" />
455
+      <window_info anchor="bottom" id="Find" order="1" />
456
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.33239833" />
457
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
458
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
459
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
460
+      <window_info anchor="bottom" id="TODO" order="6" />
461
+      <window_info anchor="bottom" id="Terminal" order="7" />
462
+      <window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
463
+      <window_info anchor="bottom" id="Version Control" order="9" />
464
+      <window_info anchor="right" id="Commander" order="0" weight="0.4" />
465
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
466
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
467
+      <window_info anchor="right" id="Palette" order="3" />
468
+      <window_info anchor="right" id="Capture Analysis" order="4" />
469
+      <window_info anchor="right" id="Theme Preview" order="5" />
470
+      <window_info anchor="right" id="Database" order="6" />
471
+      <window_info anchor="right" id="Palette&#9;" order="7" />
472
+      <window_info anchor="right" id="Maven Projects" order="8" />
338 473
     </layout>
339 474
   </component>
340 475
   <component name="TypeScriptGeneratedFilesManager">
@@ -347,113 +482,78 @@
347 482
     <MESSAGE value="readme and docs" />
348 483
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
349 484
   </component>
350
-  <component name="XDebuggerManager">
351
-    <breakpoint-manager />
352
-    <watches-manager />
353
-  </component>
354 485
   <component name="editorHistoryManager">
355 486
     <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
356
-      <provider selected="true" editor-type-id="text-editor">
357
-        <state relative-caret-position="0">
358
-          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
359
-          <folding />
360
-        </state>
361
-      </provider>
362
-    </entry>
363
-    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
364
-      <provider selected="true" editor-type-id="text-editor">
365
-        <state relative-caret-position="0">
366
-          <caret line="0" column="15" lean-forward="false" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
367
-          <folding />
368
-        </state>
369
-      </provider>
370
-    </entry>
371
-    <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
372
-      <provider selected="true" editor-type-id="text-editor">
373
-        <state relative-caret-position="34">
374
-          <caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
375
-          <folding />
376
-        </state>
377
-      </provider>
378
-    </entry>
379
-    <entry file="file://$PROJECT_DIR$/README.md">
380
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
381
-        <state split_layout="SPLIT">
382
-          <first_editor relative-caret-position="1241">
383
-            <caret line="73" column="0" lean-forward="true" selection-start-line="73" selection-start-column="0" selection-end-line="73" selection-end-column="0" />
384
-            <folding />
385
-          </first_editor>
386
-          <second_editor />
387
-        </state>
388
-      </provider>
389
-    </entry>
390
-    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
391
-      <provider selected="true" editor-type-id="text-editor">
392
-        <state relative-caret-position="0">
393
-          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
394
-          <folding />
395
-        </state>
396
-      </provider>
487
+      <provider selected="true" editor-type-id="text-editor" />
397 488
     </entry>
398
-    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
489
+    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
399 490
       <provider selected="true" editor-type-id="text-editor">
400
-        <state relative-caret-position="0">
401
-          <caret line="0" column="15" lean-forward="false" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
402
-          <folding />
491
+        <state relative-caret-position="255">
492
+          <caret line="17" selection-start-line="17" selection-end-line="17" />
493
+          <folding>
494
+            <element signature="e#200#201#0" expanded="true" />
495
+            <element signature="e#227#228#0" expanded="true" />
496
+            <element signature="e#256#257#0" expanded="true" />
497
+            <element signature="e#284#285#0" expanded="true" />
498
+          </folding>
403 499
         </state>
404 500
       </provider>
405 501
     </entry>
406
-    <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
502
+    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/MinMax.java">
407 503
       <provider selected="true" editor-type-id="text-editor">
408
-        <state relative-caret-position="34">
409
-          <caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
410
-          <folding />
504
+        <state relative-caret-position="150">
505
+          <caret line="10" column="25" selection-start-line="10" selection-start-column="25" selection-end-line="10" selection-end-column="25" />
506
+          <folding>
507
+            <element signature="e#211#212#0" expanded="true" />
508
+            <element signature="e#238#239#0" expanded="true" />
509
+            <element signature="e#264#265#0" expanded="true" />
510
+          </folding>
411 511
         </state>
412 512
       </provider>
413 513
     </entry>
414 514
     <entry file="file://$PROJECT_DIR$/README.md">
415 515
       <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
416
-        <state split_layout="SPLIT">
417
-          <first_editor relative-caret-position="1241">
418
-            <caret line="73" column="0" lean-forward="true" selection-start-line="73" selection-start-column="0" selection-end-line="73" selection-end-column="0" />
419
-            <folding />
516
+        <state split_layout="SECOND">
517
+          <first_editor>
518
+            <caret line="18" selection-start-line="18" selection-end-line="18" />
420 519
           </first_editor>
421 520
           <second_editor />
422 521
         </state>
423 522
       </provider>
424 523
     </entry>
425
-    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
426
-      <provider selected="true" editor-type-id="text-editor">
427
-        <state relative-caret-position="0">
428
-          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
429
-          <folding />
430
-        </state>
431
-      </provider>
432
-    </entry>
433 524
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
434 525
       <provider selected="true" editor-type-id="text-editor">
435
-        <state relative-caret-position="0">
436
-          <caret line="0" column="15" lean-forward="false" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
437
-          <folding />
526
+        <state relative-caret-position="369">
527
+          <caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
528
+          <folding>
529
+            <element signature="imports" expanded="true" />
530
+            <element signature="e#414#415#0" expanded="true" />
531
+            <element signature="e#448#449#0" expanded="true" />
532
+            <element signature="e#535#536#0" expanded="true" />
533
+            <element signature="e#576#577#0" expanded="true" />
534
+            <element signature="e#2864#2873#0" expanded="true" />
535
+            <element signature="e#2895#2904#0" expanded="true" />
536
+          </folding>
438 537
         </state>
439 538
       </provider>
440 539
     </entry>
441 540
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
442 541
       <provider selected="true" editor-type-id="text-editor">
443
-        <state relative-caret-position="34">
444
-          <caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
445
-          <folding />
446
-        </state>
447
-      </provider>
448
-    </entry>
449
-    <entry file="file://$PROJECT_DIR$/README.md">
450
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
451
-        <state split_layout="SPLIT">
452
-          <first_editor relative-caret-position="306">
453
-            <caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
454
-            <folding />
455
-          </first_editor>
456
-          <second_editor />
542
+        <state relative-caret-position="372">
543
+          <caret line="191" column="40" selection-start-line="191" selection-start-column="40" selection-end-line="191" selection-end-column="40" />
544
+          <folding>
545
+            <element signature="imports" expanded="true" />
546
+            <element signature="e#1970#1971#0" expanded="true" />
547
+            <element signature="e#1991#1992#0" expanded="true" />
548
+            <element signature="e#2102#2103#0" expanded="true" />
549
+            <element signature="e#2181#2182#0" expanded="true" />
550
+            <element signature="e#3139#3140#0" expanded="true" />
551
+            <element signature="e#3196#3197#0" expanded="true" />
552
+            <element signature="e#3267#3268#0" expanded="true" />
553
+            <element signature="e#3348#3349#0" expanded="true" />
554
+            <element signature="e#5073#5074#0" expanded="true" />
555
+            <element signature="e#5149#5150#0" expanded="true" />
556
+          </folding>
457 557
         </state>
458 558
       </provider>
459 559
     </entry>

+ 121
- 0
arraz/src/main/java/Arraz.java 查看文件

@@ -1,2 +1,123 @@
1
+import java.lang.reflect.Array;
2
+import java.util.*;
3
+
1 4
 public class Arraz {
5
+
6
+    public int sumValuesOfArrays(int[] intArray) {
7
+        int result = 0;
8
+        for (int i: intArray) {
9
+            result+=i;
10
+        }
11
+        return result;
12
+    }
13
+
14
+    public Double sumDoubleOfArrays(Double[] doubleArray) {
15
+        double result = 0;
16
+        for (Double d: doubleArray) {
17
+            result+=d;
18
+        }
19
+        return result;
20
+    }
21
+
22
+    public int average(int[] arr) {
23
+        return sumValuesOfArrays(arr)/arr.length;
24
+    }
25
+
26
+    public Double averageDbl(Double[] arr) {
27
+        return sumDoubleOfArrays(arr)/arr.length;
28
+    }
29
+
30
+    public boolean containsValue(int[] spiffyHandyIntArray, int i) {
31
+        for (int value: spiffyHandyIntArray) {
32
+            if(i==value){return true;}
33
+        }
34
+        return false;
35
+    }
36
+
37
+    public int[] reverse(int[] arr) {
38
+        for(int i = 0; i<arr.length/2; i++){
39
+           int temp = arr[i];
40
+           arr[i]=arr[arr.length-1];
41
+           arr[arr.length-1-i]=temp;
42
+        }
43
+        return arr;
44
+    }
45
+
46
+    public OddEven getOddEvensOfArray(int[] arr) {
47
+        int even = 0;
48
+        int odd = 0;
49
+        for (int i: arr) {
50
+            if(i%2==0) even++;
51
+            else odd++;
52
+        }
53
+        return new OddEven(odd, even);
54
+    }
55
+
56
+    public int findIndexOf(int[] arr, int value) {
57
+        for (int i=0; i<arr.length; i++) {
58
+            if (arr[i] == value) {
59
+                return i;
60
+            }
61
+            }
62
+        return -1;
63
+    }
64
+
65
+    public Integer[] copyArrayByIterator(Integer[] arr) {
66
+        Integer[] array = new Integer[arr.length];
67
+        Iterator<Integer> iterator = Arrays.asList(arr).iterator();
68
+        int counter = 0;
69
+        while(iterator.hasNext()){
70
+            array[counter]=iterator.next();
71
+            counter++;
72
+        }
73
+        return  array;
74
+        }
75
+
76
+
77
+    public int[] copyArrayByLoop(int[] arr) {
78
+        int [] result = new int[arr.length];
79
+        for(int i=0; i<arr.length; i++){
80
+            result[i]=arr[i];
81
+        }
82
+        return result;
83
+    }
84
+
85
+    public int[] removeElement(int[] arr, int val) {
86
+        int[] result = new int[arr.length];
87
+        for(int i=0; i<arr.length; i++){
88
+            if(arr[i]!=val)
89
+            result[i]=arr[i];
90
+        }
91
+        return result;
92
+    }
93
+
94
+    public int[] insertIntoArrayAt(int[] arr, int val, int index) {
95
+        int[] result = new int[arr.length+1];
96
+        int counter = 0;
97
+        for (int i = 0; i <result.length; i++) {
98
+            if (i != index){
99
+                result[i] = arr[counter];
100
+                counter++;
101
+            } else result[i] = val;
102
+        }
103
+        return result;
104
+    }
105
+
106
+    public MinMax findMinMax(int[] arr) {
107
+        Arrays.sort(arr);
108
+        return new MinMax(arr[0], arr[arr.length-1]);
109
+    }
110
+
111
+    public Integer[] removeDupes(Integer[] arr) {
112
+        ArrayList<Integer> result = new ArrayList<Integer>();
113
+        Set<Integer> set = new HashSet<Integer>();
114
+        for (Integer i : arr) {
115
+            set.add(i);
116
+        }
117
+        for (Integer i: set) {
118
+            result.add(i);
119
+        }
120
+        Integer[] foo = (Integer[]) result.toArray();
121
+        return foo;
122
+    }
2 123
 }

+ 18
- 0
arraz/src/main/java/MinMax.java 查看文件

@@ -0,0 +1,18 @@
1
+public class MinMax {
2
+
3
+    public int min;
4
+    public int max;
5
+
6
+    public MinMax(int min, int max) {
7
+        this.min = min;
8
+        this.max = max;
9
+    }
10
+
11
+    public int getMin() {
12
+        return min;
13
+    }
14
+
15
+    public int getMax() {
16
+        return max;
17
+    }
18
+}

+ 23
- 0
arraz/src/main/java/OddEven.java 查看文件

@@ -0,0 +1,23 @@
1
+public class OddEven {
2
+
3
+    public int odds;
4
+    public int evens;
5
+
6
+    public OddEven(int odds, int evens) {
7
+        this.odds = odds;
8
+        this.evens = evens;
9
+    }
10
+
11
+    public int getOdds() {
12
+        return odds;
13
+    }
14
+
15
+    public int getEvens() {
16
+        return evens;
17
+    }
18
+
19
+    public boolean equals(OddEven o){
20
+        if(o.getEvens()==evens && o.getOdds()==odds){return true;}
21
+        return false;
22
+    }
23
+}

+ 189
- 0
arraz/src/test/java/ArrazTest.java 查看文件

@@ -1,5 +1,194 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
1 4
 import static org.junit.Assert.*;
2 5
 
3 6
 public class ArrazTest {
4 7
 
8
+    private  int[] spiffyHandyIntArray = new int[] {4,5,102,6,-7,12,-32,92,8};
9
+    private  Integer[] handyIntArray = new Integer[] {4,5,102,6,-7,12,-32,92,8};
10
+    private Double[] spiffyHandyDoubleArray = new Double[] {1.0, 0.5, 3.6, 38.4, 17.3, 62.0, 9.0, 3.375, 0.0, 3.14159};
11
+    Arraz arraz = new Arraz();
12
+
13
+    @Test
14
+    public void test1sumValuesOfArrays(){
15
+        int actual = arraz.sumValuesOfArrays(spiffyHandyIntArray);
16
+        Assert.assertEquals(190, actual);
17
+    }
18
+
19
+    @Test
20
+    public void test2sumValuesOfArrays(){
21
+        int[] arr = new int[0];
22
+        int actual = arraz.sumValuesOfArrays(arr);
23
+        Assert.assertEquals(0, actual);
24
+    }
25
+
26
+    @Test
27
+    public void test1sumDoublesOfArrays(){
28
+        Double actual = arraz.sumDoubleOfArrays(spiffyHandyDoubleArray);
29
+        Assert.assertEquals(138.31650, actual, 1);
30
+    }
31
+
32
+    @Test
33
+    public void test2sumDoublesOfArrays(){
34
+        Double[] arr = new Double[0];
35
+        Double actual = arraz.sumDoubleOfArrays(arr);
36
+        Assert.assertEquals(0.0, actual);
37
+    }
38
+
39
+    @Test
40
+    public void test1Average(){
41
+        int actual = arraz.average(spiffyHandyIntArray);
42
+        int expected = arraz.sumValuesOfArrays(spiffyHandyIntArray)/spiffyHandyIntArray.length;
43
+        Assert.assertEquals(expected, actual);
44
+    }
45
+
46
+    @Test (expected = ArithmeticException.class)
47
+    public void test2Average(){
48
+        int[] arr = new int[0];
49
+        int actual = arraz.average(arr);
50
+    }
51
+
52
+    @Test
53
+    public void test1AverageDbl(){
54
+        Double actual = arraz.averageDbl(spiffyHandyDoubleArray);
55
+        Double expected = arraz.sumDoubleOfArrays(spiffyHandyDoubleArray)/spiffyHandyDoubleArray.length;
56
+        Assert.assertEquals(expected, actual);
57
+    }
58
+
59
+    @Test (expected = NullPointerException.class)
60
+    public void test2AverageDbl(){
61
+        Double[] arr = new Double[1];
62
+        Double actual = arraz.averageDbl(arr);
63
+        Assert.assertEquals(null, actual);
64
+    }
65
+
66
+    @Test
67
+    public void test1ContainsValue(){
68
+        Assert.assertTrue(arraz.containsValue(spiffyHandyIntArray, 5));
69
+    }
70
+
71
+    @Test
72
+    public void test2ContainsValue(){
73
+        Assert.assertFalse(arraz.containsValue(spiffyHandyIntArray, 2));
74
+    }
75
+
76
+    @Test
77
+    public void test1ReverseArray(){
78
+        int[] arr = new int[] {8,92,-32,12,-7,6,102,5,4};
79
+        Assert.assertEquals(arraz.reverse(spiffyHandyIntArray), spiffyHandyIntArray);
80
+    }
81
+
82
+    @Test
83
+    public void test2ReverseArray(){
84
+        int[] arr = new int[] {8,92,-32,12,-7,6,102,5,4};
85
+        Assert.assertNotSame(arraz.reverse(spiffyHandyIntArray), arr);
86
+    }
87
+
88
+    @Test
89
+    public void test1getOddEvensOfArray(){
90
+        OddEven actual = arraz.getOddEvensOfArray(spiffyHandyIntArray);
91
+        OddEven expected = new OddEven(2,7);
92
+        Assert.assertEquals(expected.getEvens(), actual.getEvens());
93
+    }
94
+
95
+    @Test
96
+    public void test2OddEvensOfArray(){
97
+        OddEven actual = arraz.getOddEvensOfArray(spiffyHandyIntArray);
98
+        OddEven expected = new OddEven(2,7);
99
+        Assert.assertEquals(expected.getOdds(),actual.getOdds());
100
+    }
101
+
102
+    @Test
103
+    public void test1FindIndexOf(){
104
+        Assert.assertEquals(arraz.findIndexOf(spiffyHandyIntArray, 5), 1);
105
+    }
106
+
107
+    @Test
108
+    public void test2FindIndexOf(){
109
+        Assert.assertEquals(arraz.findIndexOf(spiffyHandyIntArray, 1), -1);
110
+    }
111
+
112
+    @Test
113
+    public void test1CopyArrayByIterator(){
114
+        Integer[] actual = arraz.copyArrayByIterator(handyIntArray);
115
+        Integer[] arr = new Integer[] {4,5,102,6,-7,12,-32,92,8};
116
+        for (int i=0; i<arr.length; i++){
117
+            Assert.assertEquals(arr[i], actual[i]);
118
+        }
119
+    }
120
+
121
+    @Test
122
+    public void test2CopyArrayByIterator(){
123
+        Integer[] actual = arraz.copyArrayByIterator(handyIntArray);
124
+        Integer[] expected = new Integer[] {4,5,102,6,-7,12,-32,92,8};
125
+        Assert.assertNotSame(expected,actual);
126
+    }
127
+
128
+    @Test
129
+    public void test1CopyArrayByLoop(){
130
+        int[] actual = arraz.copyArrayByLoop(spiffyHandyIntArray);
131
+        int[] arr = new int[] {4,5,102,6,-7,12,-32,92,8};
132
+        for (int i=0; i<arr.length; i++){
133
+            Assert.assertEquals(arr[i], actual[i]);
134
+        }
135
+    }
136
+
137
+    @Test
138
+    public void test2CopyArrayByLoop(){
139
+        int[] actual = arraz.copyArrayByLoop(spiffyHandyIntArray);
140
+        int[] expected = new int[] {4,5,102,6,-7,12,-32,92,8};
141
+        Assert.assertNotSame(expected,actual);
142
+    }
143
+
144
+    @Test
145
+    public void test1RemoveElement(){
146
+        int[] arr = arraz.removeElement(spiffyHandyIntArray, -7);
147
+        Assert.assertFalse(arraz.containsValue(arr, -7));
148
+    }
149
+
150
+    @Test
151
+    public void test2RemoveElement(){
152
+        int [] arr = arraz.removeElement(spiffyHandyIntArray, 1);
153
+        Assert.assertFalse(arraz.containsValue(arr, 1));
154
+    }
155
+
156
+    @Test
157
+    public void test1InsertIntoArrayAt(){
158
+        int[] arr = arraz.insertIntoArrayAt(spiffyHandyIntArray,2,2);
159
+        Assert.assertEquals(arr[2], 2);
160
+    }
161
+
162
+    @Test(expected = ArrayIndexOutOfBoundsException.class)
163
+    public void test2InsertIntoArrayAt(){
164
+        int[] arr = arraz.insertIntoArrayAt(spiffyHandyIntArray,2,25);
165
+    }
166
+
167
+    @Test
168
+    public void test1FindMinMax(){
169
+        MinMax actual = arraz.findMinMax(spiffyHandyIntArray);
170
+        MinMax  expected = new MinMax(-32,102);
171
+        Assert.assertEquals(expected.getMax(), actual.getMax());
172
+    }
173
+
174
+    @Test
175
+    public void test2FindMinMax(){
176
+        MinMax actual = arraz.findMinMax(spiffyHandyIntArray);
177
+        MinMax  expected = new MinMax(-32,102);
178
+        Assert.assertEquals(expected.getMin(), actual.getMin());
179
+    }
180
+
181
+    @Test
182
+    public void test1RemoveDupes(){
183
+        Integer[] arr = new Integer[]{3,3,3,5,2,8};
184
+        arr = arraz.removeDupes(arr);
185
+        Assert.assertEquals(arr.length, 4);
186
+    }
187
+
188
+    @Test
189
+    public void test2RemoveDupes(){
190
+        Integer[] arr = new Integer[]{4,3,5,2,8,2,5};
191
+        arr = arraz.removeDupes(arr);
192
+        Assert.assertEquals(arr.length, 5);
193
+    }
5 194
 }