Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
5739dca
first commit Task_1
EugeneZakhno Jul 31, 2019
38d49c8
second commit Task_1
EugeneZakhno Jul 31, 2019
33cd798
second commit Task_1
EugeneZakhno Aug 1, 2019
4548840
first commit Task_2
EugeneZakhno Aug 1, 2019
aeb9135
first commit Task_3
EugeneZakhno Aug 1, 2019
4a50e9f
first commit Task_4
EugeneZakhno Aug 1, 2019
3f03a23
first commit Task_4
EugeneZakhno Aug 2, 2019
3c7531b
first commit for Task_5
EugeneZakhno Aug 2, 2019
6218aa5
first commit Task_6
EugeneZakhno Aug 4, 2019
4ea9cc4
first commit Task_7
EugeneZakhno Aug 4, 2019
f4c2321
second commit Task_7
EugeneZakhno Aug 7, 2019
69f0b95
third commit Task_7
EugeneZakhno Aug 7, 2019
86215f8
forth commit Task_7
EugeneZakhno Aug 7, 2019
bc0600d
fifth commit Task_7
EugeneZakhno Aug 7, 2019
216a3f6
first commit for all
EugeneZakhno Aug 8, 2019
bfc39ac
second commit for all
EugeneZakhno Aug 8, 2019
f4da266
second commit Task_7
EugeneZakhno Aug 8, 2019
6002be2
first commit Task_8
EugeneZakhno Aug 8, 2019
e9dc36b
third commit for all
EugeneZakhno Aug 8, 2019
4815b52
first commit for Task_9
EugeneZakhno Aug 8, 2019
3137d06
fifth commit for all
EugeneZakhno Aug 8, 2019
0c4ab20
first commit for Task_10
EugeneZakhno Aug 8, 2019
d936d4b
sixth commit for all
EugeneZakhno Aug 8, 2019
4b2699c
Delete modules.xml
EugeneZakhno Aug 8, 2019
7be08db
Delete .gitignore
EugeneZakhno Aug 8, 2019
8e2cc0c
Delete 2_Algorithmization.iml
EugeneZakhno Aug 8, 2019
377d821
Delete compiler.xml
EugeneZakhno Aug 8, 2019
1f9608c
Delete misc.xml
EugeneZakhno Aug 8, 2019
cdd3b12
Delete vcs.xml
EugeneZakhno Aug 8, 2019
d44cd11
Delete workspace.xml
EugeneZakhno Aug 8, 2019
ed91282
Delete .gitignore
EugeneZakhno Aug 8, 2019
260d9db
fix gitignore
EugeneZakhno Aug 8, 2019
d3f39c4
Update README.md
EugeneZakhno Aug 9, 2019
b317146
Update README.md
EugeneZakhno Aug 9, 2019
d39550d
Update README.md
EugeneZakhno Aug 9, 2019
19e42a2
Update README.md
EugeneZakhno Aug 9, 2019
d68bc52
first commit task_12
EugeneZakhno Aug 17, 2019
df4a29c
First commit for Task_13
EugeneZakhno Aug 19, 2019
f5d0c42
first commit for Task_14
EugeneZakhno Aug 19, 2019
3bbb113
first commit Task_15
EugeneZakhno Aug 19, 2019
95d6fd8
Update README.md
EugeneZakhno Aug 21, 2019
0571c37
Update README.md
EugeneZakhno Aug 21, 2019
0d3389e
Update README.md
EugeneZakhno Aug 21, 2019
0aa1eb4
common commit for Task18-22
EugeneZakhno Aug 21, 2019
aa2a8eb
df
EugeneZakhno Aug 21, 2019
66ee490
commit for tasks 23-25
EugeneZakhno Aug 22, 2019
c12fe68
commit for Task_27
EugeneZakhno Aug 25, 2019
0ba3889
Commit for Task_28
EugeneZakhno Aug 25, 2019
0476031
Commit for Task_29
EugeneZakhno Aug 25, 2019
e43bbc1
Commit for Task_29
EugeneZakhno Aug 25, 2019
17462ad
second commit for Task_29
EugeneZakhno Aug 25, 2019
842ae67
first commit for Task_30
EugeneZakhno Aug 26, 2019
4373256
first commit for Task_31
EugeneZakhno Aug 27, 2019
2f9ad8e
first commit for Task_32
EugeneZakhno Aug 27, 2019
5ead576
first commit for Task_33
EugeneZakhno Aug 27, 2019
c6724fb
first commit for Task_34
EugeneZakhno Aug 27, 2019
f5eeb17
first commit for Task_35
EugeneZakhno Aug 27, 2019
a52417d
second commit for Task_35
EugeneZakhno Aug 27, 2019
5c8f2dd
first commit for Task_36
EugeneZakhno Aug 27, 2019
17129a4
first commit for Task_37
EugeneZakhno Aug 28, 2019
3f46f79
first commit for Task_38
EugeneZakhno Aug 28, 2019
6bfd707
first commit for Task_39
EugeneZakhno Aug 28, 2019
e05c3dd
second commit for Task_39
EugeneZakhno Aug 28, 2019
e7d5438
second commit for Task_40
EugeneZakhno Aug 28, 2019
7afbc8a
second commit for Task_41
EugeneZakhno Aug 28, 2019
4ddaa14
second commit for Task_42
EugeneZakhno Aug 29, 2019
7288dd5
first commit for Task_43
EugeneZakhno Aug 29, 2019
2eb97dd
first commit for Task_44
EugeneZakhno Aug 29, 2019
7f2fb70
first commit for Task_45
EugeneZakhno Aug 29, 2019
995f67e
first commit for Task_46
EugeneZakhno Aug 29, 2019
7c3e320
first commit for Task_47
EugeneZakhno Aug 29, 2019
e746777
first commit for Task_48
EugeneZakhno Aug 29, 2019
dc1fc7a
first commit for Task_49
EugeneZakhno Aug 29, 2019
18fbc41
first commit for Task_50
EugeneZakhno Aug 29, 2019
cc5fd11
first commit for Task_51
EugeneZakhno Aug 29, 2019
0b1496a
Update README.md
EugeneZakhno Aug 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.DS_Store
*.swp
index.data
*~
html/*.html
html/css/style.css
html/css/style.css.map
html/perl6.xhtml
html/routine/
html/type/
html/op/
html/language/
html/programs/
html/syntax/
html/images/type-graph*
html/js/search.js
.precomp
precompiled
assets/assetpack.db
assets/cache
.sass-cache/
html/css/style.css.map
html/links.txt
xt/aspell.pws
highlights/node_modules
**/npm-debug.log
highlights/atom-language-perl6/
.DS_store
highlights/package-lock.json

# IDE specific
.scala_dependencies
.classpath
*.iml
.idea/
.idea_modules/
.project
.settings/
*.sublime-project
*.sublime-workspace
/.env
atlassian-ide-plugin.xml
114 changes: 114 additions & 0 deletions Commit_for_Task_29.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Index: Task30/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Task30/pom.xml (date 1566754829510)
+++ Task30/pom.xml (date 1566754829510)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>io.github.EugeneZakhno</groupId>
+ <artifactId>Task#30</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>7</source>
+ <target>7</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
\ No newline at end of file
Index: Task30/src/main/java/Task_31.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Task30/src/main/java/Task_31.java (date 1566754870102)
+++ Task30/src/main/java/Task_31.java (date 1566754870102)
@@ -0,0 +1,53 @@
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+/*
+ ENG:
+ Given two one-dimensional arrays with a different number of elements and a natural number k. Combine them into
+        one array, including the second array between the kth and (k + 1) - m elements of the first, without using
+        additional array.
+
+ RUS:
+ 3.1 Заданы два одномерных массива с различным количеством элементов и натуральное число k. Объединить их в
+ один массив, включив второй массив между k-м и (k+1) - м элементами первого, при этом не используя
+ дополнительный массив.
+*/
+public class Task_31 {
+ public static void main(String[] args) {
+ try (BufferedReader read = new BufferedReader(new InputStreamReader(System.in))) {
+
+ System.out.println("Enter quantity an elements of first array: ");
+ int n = Integer.parseInt(read.readLine());
+ int [] firstArray = new int [n];
+
+ for (int i = 0; i < firstArray.length; i++) {
+ firstArray[i]= (int) (Math.random()*100)-50;
+ System.out.print(firstArray[i] + ", ");
+ }
+
+ System.out.println("\n\nEnter quantity an elements of second array: ");
+ int m = Integer.parseInt(read.readLine());
+ int [] secondArray = new int [m];
+
+ for (int i = 0; i < secondArray.length; i++) {
+ secondArray[i]= (int) (Math.random()*100)-50;
+ System.out.print(secondArray[i] + ", ");
+ }
+
+ System.out.println("\n\nChoose number from first array: ");
+ int k = Integer.parseInt(read.readLine());
+
+ System.out.println("\n\nResult of joining two arrays : ");
+ for (int i = 0; i < firstArray.length; i++) {
+ System.out.print(firstArray[i] + ", ");
+ if (k == firstArray[i]) {
+ for (int j = 0; j < secondArray.length; j++) {
+ System.out.print(secondArray[j] + ", ");
+ }
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
Index: Task29/src/main/java/Task_29.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Task29/src/main/java/Task_29.java (revision 04760319245891965ebc24f9a56adf4281630b80)
+++ Task29/src/main/java/Task_29.java (date 1566756071435)
@@ -41,8 +41,9 @@
array[i] = array[max];
array[max] = temp;
}
- for (int value : array)
- System.out.print(value + ", ");
+ for (int i = 0; i < array.length-1; i++) {
+ System.out.print(array[i] + ", ");
+ }

} catch (IOException e) {
e.printStackTrace();
146 changes: 142 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,145 @@
# Algorithmization

# 2_Algorithmization
Описание файлов:

- Practice (tasks).pdf - файл содержит список задач, которые нужно решить для завершения этапа.
- [Practice (tasks).pdf](https://github.com/EugeneZakhno/2_Algorithmization/blob/master/Practice%20(tasks).pdf) - файл содержит список задач, которые нужно решить для завершения этапа.
- Questions.pdf - файл содержит вопросы, на которые нужно уметь отвечать по завершению этапа.
- Recommendations.pdf - файл содержит рекомендуемые материалы (видео и книги), к которым следует обратиться при возникновении трудностей при решении задач или ответах на вопросы.

Решение задач

```java
import java.util.Arrays;
import java.util.Scanner;

1.ENG:Natural numbers are entered in the array A [N].
Find the sum of those elements that are multiples of a given K.
1. RUS: В массив A [N] занесены натуральные числа. Найти сумму тех элементов, которые кратны данному К.

public class Task_1 {
public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);
System.out.println("Enter a size of array:");
int n = scanner.nextInt();
int[] array = new int[n];
System.out.println("Enter natural number k ");
int k = scanner.nextInt();

int sum = 0;
for (int i = 0; i < array.length; i++) {
array[i] = (int) (Math.random() * 100);
}
System.out.print(Arrays.toString(array) + "\n");

for (int i = 0; i < array.length; i++) {
if (array[i] % k == 0) {
sum = sum + array[i];
}
}
System.out.print("The sum of elements that are multiples of " + k + " is " + sum);
}
}
```
__________________________________________________________________________________________________________________________________
```java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Task_11 {
public static void main(String[] args) {
/* ENG 1. A matrix is given. Display all the odd columns
         *          whose first element is larger than the last.
* RUS 1. Дана матрица. Вывести на экран все нечетные столбцы,
* у которых первый элемент больше последнего.
*/
try (BufferedReader read = new BufferedReader(new InputStreamReader(System.in))) {
System.out.println("Enter quality of strings");
int n = Integer.parseInt(read.readLine());
System.out.println("Enter quality of columns");
int m = Integer.parseInt(read.readLine());
int[][] matrix = new int[n][m];
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[i].length; j++) {
int positiveNegative = Math.random() < 0.5 ? -1 : 1;
matrix[i][j] = (int) (Math.random() * 100) * positiveNegative;
System.out.printf("%3d ", matrix[i][j]);
}
System.out.println();
}
System.out.println();

//Output result of matrix
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[i].length; j++) {
if(j%2==0 && matrix[0][j] > matrix[n-1][j])
System.out.printf(" %3d", matrix[i][j]);
}
System.out.println();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
```
______________________________________________________________________________________________________________________________
``` java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/* Eng:
In the numerical matrix, swap two columns of any column,
i.e., put all the elements of one column at the corresponding
positions of the other, and move the elements of the second to the first.
Column numbers are entered by the user from the keyboard.
*/
/* Rus:
В числовой матрице поменять местами два столбца любых столбца,
т. е. все элементы одного столбца поставить на соответствующие
им позиции другого, а его элементы второго переместить в первый.
Номера столбцов вводит пользователь с клавиатуры.
*/
public class Task_18 {
public static void main(String[] args) {
try (BufferedReader read = new BufferedReader(new InputStreamReader(System.in))) {
System.out.println("Enter quality of strings");
int n = Integer.parseInt(read.readLine());
System.out.println("Enter quality of columns");
int m = Integer.parseInt(read.readLine());
int[][] matrix = new int[n][m];
int swap;
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[i].length; j++) {
int positiveNegative = Math.random() < 0.5 ? -1 : 1;
matrix[i][j] = (int) (Math.random() * 100) * positiveNegative;
System.out.printf("%3d ", matrix[i][j]);
}
System.out.println();
}
System.out.println();
System.out.println("Choose the number 1 of column that you want to change: ");
int s = Integer.parseInt(read.readLine()) - 1;
System.out.println("Choose the number 2 of column that you want to change: ");
int z = Integer.parseInt(read.readLine()) - 1;

for (int i = 0; i < matrix.length; i++) {
swap = matrix[i][s];
matrix[i][s] = matrix[i][z];
matrix[i][z] = swap;
}

for (int[] array : matrix) {
for (int element : array) {
System.out.printf("%3d ", element);
}
System.out.println();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
__________________________________________________________________________________________________________________________________

```
15 changes: 15 additions & 0 deletions Task0/Task0.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
12 changes: 12 additions & 0 deletions Task0/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>Algorithmization</groupId>
<artifactId>Task#0</artifactId>
<version>1.0-SNAPSHOT</version>


</project>
15 changes: 15 additions & 0 deletions Task01/Task1.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
12 changes: 12 additions & 0 deletions Task01/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>Algorithmization</groupId>
<artifactId>Task#1</artifactId>
<version>1.0-SNAPSHOT</version>


</project>
Loading