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 8313227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:25:13+00:00 2026-06-08T20:25:13+00:00

Given a NxN matrix, how could I find all possible paths to a location

  • 0

Given a NxN matrix, how could I find all possible paths to a location (i,i). Navigation would be only downwards and towards the right. The starting point would be (0,0).

P.S. Not a homework.

  • 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-08T20:25:15+00:00Added an answer on June 8, 2026 at 8:25 pm

    The easiest (for me) would be to do it recursively:

    1) the stop condition would be arriving at (i,i)

    2) you would try two next moves at each recursion level:

    • can you go down
    • can you go right

    Assuming that your current position is (x,y):
    You cannot go right if your current “y” plus 1 would be bigger than “i” in the (i,i).
    You cannot go down if your current “x” plus 1 would be bigger than “i” in the (i,i).

    You’d just have to remember the path in some variable or pass it downwards and print it when the stop condition occurs.

    So assuming you start at (0,0) you remember this and then check if you can go right or down, if yes for both then you recursively call this same method for (0,1) and (1,0).

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

Sidebar

Related Questions

Given an NxN binary matrix (containing only 0's or 1's), how can we go
Given a NxN matrix with 0s and 1s. Set every row that contains a
Given a MySQL table of real estate data, I would like to generate a
I am looking to traverse a NxN area, given the starting points X,Y and
I'd like to implement a system that generates unique NxN blocks when given a
I'd like to build a function, which, given a 2D matrix and some element
Given a grid of nxn squares, where each square has an id, the first(top
Given: var input_val = $('#field').val(); How do I check whether input_val contains only numbers
a grid of NxN is given. each point is assigned a value say num
Given SQL Server 2008, I have written a simple find in string function as

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.