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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:26:59+00:00 2026-05-29T13:26:59+00:00

What would the code be to test whether an array is two-dimensional? For one

  • 0

What would the code be to test whether an array is two-dimensional? For one dimension I know that reversing the list will work. For two-dimensions I know that the opposite row / column must be the same. In other words [1][2] must equal [2][1] and so forth.

(defun symmetric-check (list) (equal list (reverse list)))

  • 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-29T13:27:00+00:00Added an answer on May 29, 2026 at 1:27 pm

    It depends on your definition of symmetry.

    In linear algebra, a matrix is called symmetric iff it is equal to its transpose (this is equivalent to saying that M[i, j] = M[j, i] for all i and j). Thus,

    (defun matrix-symmetric-p (m)
      (equal m (transpose-matrix m)))
    
    (defun transpose-matrix (m)
      ;; implement this
      ...)
    

    I strongly recommend using actual arrays, though, because it will make doing things like this easier and much more efficient.

    (defun matrix-symmetric-p (m)
      (loop for i from 0 below (array-dimension m 0)
            always
              (loop for j from 0 below (array-dimension m 1)
                    always
                      (= (aref m i j) (aref m j i)))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would you test the following code? public IList<T> Find(DetachedCriteria criteria) { return criteria.GetExecutableCriteria(session).List<T>();
Working on some code today, I found that the following would work in 5.3,
I have written the code below to test whether a list is a Palindrome
This kind of code would normally work in PHP, but since the scope is
I would like to know if the following code would be a good pattern
What would be the code for creating a table with two foreign keys? I
From inside a batch file, I would like to test whether I'm running with
I would like to write unit tests to test whether a dependency exists between
I know that you can create new classes in R, but why would you
At work we have a very large code-base that we commonly export for a

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.