Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 1.77 KB

File metadata and controls

19 lines (12 loc) · 1.77 KB

Multidimensional Arrays

  1. Write a program that fills and prints a matrix of size NxN as shown below: (examples for N = 4)

Screenshot

  1. Write a program that reads a rectangular matrix of size NxM and finds in it the square 3x3 that has maximal sum of its elements.
  • We are given a matrix of strings of size NxM. Sequences in the matrix we define as sets of several neighbor elements located on the same line, column or diagonal. Write a program that finds the longest sequence of equal strings in the matrix. Example:

    Screenshot

  1. Write a program, that reads from the console an array of N integers and an integer K, sorts the array and using the method Array.BinarySearch() finds the largest number in the array which is <= K.
  • You are given an array of strings. Write a method that sorts the array by the length of its elements (the number of characters composing them).
  • * Write a class Matrix to hold a matrix of integers. Overload the operators for adding, subtracting and multiplying of matrices, indexer for accessing the matrix content and ToString().
  • * Write a program that finds the largest area of equal neighbor elements in a rectangular matrix and prints its size. Example:

Screenshot

Hint: you can use the algorithm "Depth-first search" or "Breadth-first search".