浏览代码

add week three questions

Froilan Miranda 6 年前
父节点
当前提交
910b15c51d
共有 2 个文件被更改,包括 28 次插入3 次删除
  1. 3
    3
      Week 2.md
  2. 25
    0
      Week 3.md

+ 3
- 3
Week 2.md 查看文件

@@ -1,4 +1,4 @@
1
-## Week 1
1
+## Week 2
2 2
 ### Problem 1
3 3
 
4 4
 Write a Java program to insert an element (specific index and value) into an array. Shifting the rest of the elements to the right
@@ -7,7 +7,7 @@ Write a Java program to insert an element (specific index and value) into an arr
7 7
 Index : 2
8 8
 Value : 5
9 9
 Original Array : [25, 14, 56, 15, 36, 56, 77, 18, 29, 49]                                                     
10
-New Array: [25, 14, 5, 56, 15, 36, 56, 77, 18, 29] 
10
+New Array: [25, 14, 5, 56, 15, 36, 56, 77, 18, 29]
11 11
 ```
12 12
 
13 13
 ### Problem 2
@@ -17,6 +17,6 @@ Write a Java program to remove a specific element(by index) from an array.
17 17
 ```
18 18
 Index : 1
19 19
 Original Array : [25, 14, 56, 15, 36, 56, 77, 18, 29, 49]                                                     
20
-After removing the second element: [25, 56, 15, 36, 56, 77, 18, 29, 49, 49] 
20
+After removing the second element: [25, 56, 15, 36, 56, 77, 18, 29, 49, 49]
21 21
 
22 22
 ```

+ 25
- 0
Week 3.md 查看文件

@@ -0,0 +1,25 @@
1
+## Week 3
2
+### Problem 1
3
+
4
+Write a Java program to find the maximum and minimum value of an array.
5
+
6
+```
7
+Original Array: [25, 14, 56, 15, 36, 56, 77, 18, 29, 49]
8
+Maximum value for the above array = 77
9
+Minimum value for the above array = 14
10
+```
11
+
12
+### Problem 2
13
+
14
+Write a Java program to find the duplicate values of an array of integer values.
15
+
16
+Input:
17
+```
18
+Input Array : [1, 2, 5, 5, 6, 6, 7, 2]
19
+```
20
+Output:
21
+```
22
+Duplicate Element : 2
23
+Duplicate Element : 5
24
+Duplicate Element : 6
25
+```