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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:40:34+00:00 2026-05-13T16:40:34+00:00

I’m working on a java assignment for a class and I’m unsure how to

  • 0

I’m working on a java assignment for a class and I’m unsure how to solve this problem. I don’t want it completed for me, but get me started in the right direction. I’m mostly unsure of the recursive part of the program. I’m not very good at programming.

problem:

NorthEast paths are obtained from a
two-dimensional grid by moving up and
right. For example, in the figure
below, there are two paths from 1,0 to
0,1. The first is (1,0), (0,0), (0,1),
the second is (1,0), (1,1), (0,1).
Note that there are no NorthEast paths
from (0,1) to any other point. Also
note that there is one NorthEast path
from (1,1) to (0,1). You are to write
a program that takes a number (size of
grid – no larger than 10) and a
starting location and an ending
location and recursively computes all
of the “NorthEast” paths.

0,0 0,1

1,0 1,1

I’m reading in the file prog2.dat

which reads in the grid size first and then the starting coordinates and then finishing coordinates. for example:

5

3 0

1 3

It needs to be one files, so I’m going to use methods. If someone could get me started or direct me to a similar question already posted, I would appreciate it.

  • 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-05-13T16:40:35+00:00Added an answer on May 13, 2026 at 4:40 pm

    One solution involving recursion involves finding the next point on the path that will get you closest to your destination. Once you have that point, you then use the same method to figure out the next closest point and so on. This process (or the recursion) ends when you have arrived at your destination.

    You can try doing something like this:

    void getNextPoint(Point start, Point end, Path currentPath) {
        //if start == end, then you're done with the recursion
        //and you have a valid path
    
        //if you can move east from start to get closer to end
        //Point next = east of start
        //append next to the currentPath
        //then call getNextPoint(next, end, currentPath)
    
        //if you can move north from start to get closer to end
        //Point next = north of start
        //append next to currentPath
        //then call getNextPoint(next, end, currentPath)
    }
    

    I’ve omitted a lot of details so you can figure out more for yourself, but that’s one approach to using recursion. Essentially, you’re building up a path. You’ll have to figure out how to manage your Paths, but chances are you will need to be able to push and pop points off of them.

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

Sidebar

Ask A Question

Stats

  • Questions 412k
  • Answers 412k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The performance overhead is mostly prepaid; it's the result of… May 15, 2026 at 8:05 am
  • Editorial Team
    Editorial Team added an answer Rather than checking the file size I'd suggest creating a… May 15, 2026 at 8:05 am
  • Editorial Team
    Editorial Team added an answer You might want to take a look at a Ruby… May 15, 2026 at 8:05 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.