Skip to content

ADv0rnik/2_Algorithmization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2_Algorithmization

Second module of Introduction to JAVA course (by EPAM)

One-dimensional arrays

Exercise01. Find the sum of elements in the array A[N] that are multiples of a given K.

Exercise02. Replace all elements of the array greater than the given Z with this value. Show number of replacements.

Exercise03. Count number of positive, negative and zero elements in the array.

Exercise04. Swap the largest and smallest elements in the array.

Exercise05. Print only those numbers for which ai> i.

Exercise06. Calculate the sum of numbers whose ordinal numbers are prime numbers.

Exercise07. Define max(a1 + a_2n, a2 + a_2n-1, ..., a_n + a_n+1) for an array of real numbers

Exercise08. Given a sequence of integers a1,a2,...,a_n. Create a new sequence by removing from the original those elements that are correspond to min(a1,a2, ,an).

Exercise09. In an array of integers with length n find the most common number. If there are more than one of these numbers, define the smallest one.

Exercise10. Compress the array, discarding every second element from it (fill the vacated elements with zeros).

Arrays of arrays.

Exercise11. A matrix is given. Display all odd columns with the first item greater than the last.

Exercise12. A square matrix is given. Display all elements on a diagonal

Exercise13. A matrix is given. Print the k-row and p-column of the matrix

Exercise14. Create a square matrix of order n according to a given pattern (n is even): | 1 2 3 ... n | | n n-1 n-2 ... 1 | | 1 2 3 ... n | | n n-1 n-2 ... 1 | | 1 2 3 ... n | | n n-1 n-2 ... 1 |

About

Introduction to JAVA (by EPAM

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages