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

  • Home
  • SEARCH
  • 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 7940739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:28:00+00:00 2026-06-03T23:28:00+00:00

My lecturer has supplied some pseudocode in his course notes for the n-Queens problem.

  • 0

My lecturer has supplied some pseudocode in his course notes for the n-Queens problem. Unfortunately I’m having a bit of a hard time understanding it to do an implementation in Java. The pseudocode in question is:

Queens (currentBoard , currentRow, n) :
    if currentRow == n:
        if currentBoard is legal:
            return <currentBoard, 1>
        else:
            return <currentBoard, 0>
    else:
        for k = 1..n:
            newBoard = currentBoard + <currentRow+1, k>
            board [k], success[k] = Queens(newBoard, currentRow+1, n)
        kmax = index of max(success[k])
        return <board[kmax], success[kmax]>

Most of it I understand but I’m not sure what I’m meant to do with the parts of the pseudocode that are in the angle brackets.

  • 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-03T23:28:02+00:00Added an answer on June 3, 2026 at 11:28 pm

    The angle brackets here just say, that multiple “objects” are returned.

    So, for example, this code

    return <currentBoard, 1>
    

    returns on the one hand the currentBoard object and on the other hand a simple 1.

    In this code

    board [k], success[k] = Queens(newBoard, currentRow+1, n)
    

    you can see that both objects are stored into different variables, to board goes into board[k] and the number goes into success[k].

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

Sidebar

Related Questions

My lecturer gave the following as an in lecturer lab but i'm having trouble
I'm going through some lecture notes, Fundamentals of Mathematica Programming (see the .nb file
Some time ago (~4-5months ago) I attented a lecture about Java EE and at
The code is from K. Pollari-Malmi's lecture notes for the course Introduction to Programming:
I have some ontology (campus.owl). There are tree classes (Student, Sport, Lecturer). Student class
When designing both the domain-model and class-diagrams I am having some trouble understanding what
I'm creating a database using entity framework code first and I'm having some issues
Hi my teacher has planned to do some programming teaching for us .He said
So the new Google custom Search has rolled out and im having trouble displaying
From the lectures notes of a course at university, on call-by-value: void fun(int *ip)

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.