Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9187073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:41:02+00:00 2026-06-17T19:41:02+00:00

My input is a text document grid of 0’s and 1’s, which i then

  • 0

My input is a text document grid of 0’s and 1’s, which i then put into a two dimensional integer array.

The object for me is to “map” the 1’s in the grid. I have to determine how many groups of 1’s there are, how many each group has, and create a output text with the 1 groups labeled.

for example i receive the following in text:

1 0 1 0 0 1 0
1 1 1 0 1 1 0
1 0 0 0 1 0 0
0 0 1 0 0 0 1
0 0 1 1 1 1 1

I would have three total groups, then have to spit it out like:

1 0 1 0 0 2 0
1 1 1 0 2 2 0
1 0 0 0 2 0 0
0 0 3 0 0 0 3
0 0 3 3 3 3 3 

As I’m doing my recursion, I created a two dimensional integer ArrayList to be expandable to groups and group members. I thought before that if i just changed all the “members” of the second group to 2’s, then they should change in the original two dimensional Array because arrays are passed by reference.

Am I wrong? Let me know if any additional information needs to be given too.

Thanks in advance.

Edit: if use the ArrayList.contains() function, it seems i have the problem that its looking if it contains an actual “1” not if it contains int[][] array[0][1] for example.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:41:03+00:00Added an answer on June 17, 2026 at 7:41 pm

    Sounds a lot like a Region Labelling algorithm to me. Maybe this will help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two input text boxes which are decimal. The sum of the two
I'm trying to set the focus on a text input element using document.getElementById( 'id'
$(document).ready(function() { function countChecked() { var n = $(input:checked).length; $(div).text(n + (n <= 1
<input type=text value=click onclick=textClicked()> <script> function textClicked() { document.write(‘Text clicked’); } </script> OR <input
For input text files, I know that .seek and .tell both operate with bytes,
I have this input text and an input button...I am looking to have them
I have this input text and input button, I am trying to get them
I have multiple input text fields grouped in divs: <div class=container0> <input class=containerItem0 name=containerItem[0][0]
I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
I have an input (text field) in update panel, and it autopostbacks after each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.