Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matematicki problem - nalazenje najduzeg kontinualnog niza
#11
Hmm, ovaj matetmaticki problem je ustvari pitanje na konkursu za programere kod Amazon-a : )

Quote:Find length of the largest region in Boolean Matrix

Consider a matrix with rows and columns, where each cell contains either a ‘0’ or a ‘1’ and any cell containing a 1 is called a filled cell. Two cells are said to be connected if they are adjacent to each other horizontally, vertically, or diagonally. If one or more filled cells are also connected, they form a region. find the length of the largest region.

https://www.geeksforgeeks.org/find-lengt...an-matrix/

Examples:

Input : M[][5] = {
                  0 0 1 1 0
                  1 0 1 1 0
                  0 1 0 0 0
                  0 0 0 0 1 }
Output : 6
In the following example, there are
2 regions one with length 1 and the
other as 6. So largest region: 6

Input : M[][5] = {
                  0 0 1 1 0
                  0 0 1 1 0
                  0 0 0 0 0
                  0 0 0 0 1 }
Output: 6
In the following example, there are
2 regions one with length 1 and the
other as 4. So largest region: 4

Koliko razumem isti je problem samo je kod mene drugacija projekcija tacaka (koju sam odradio) i treba mi 1 x N matrica umesto M x N
Ovo nalazi najveci region i onda znam da mi je to objekat koji se prati, sve ostalo su smetnje.
Reply


Messages In This Thread
RE: Matematicki problem - nalazenje najduzeg kontinualnog niza - by mikikg - 07-13-2020, 07:10 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)