Questions tagged [symmetric]

is used in its general meaning, so you are encouraged to use one or more tags in addition to this tag, to describe your case better.

An example of Symmetric would be a Symmetric Key, which is used in both the sides of an algorithm in cryptography.

170 questions
-1
votes
2 answers

Prolog: Test if an arbitrary list is symmetric

Is there a way to test wether an arbitrary list is symmetric? For example: ?- symmetric([a,b,b,a]). true. ?- symmetric([a,b,c,a]). false. ?- symmetric([a,a]). true. My attemp was to compare the first element to the last element and if they are…
Chris
  • 9,209
  • 16
  • 58
  • 74
-2
votes
1 answer

Java - 2darray.length: how make loop through colums instead of rows?

public static int[] getMinimumSymmetricOfEveryRow (int [][] A) { int min = Integer.MAX_VALUE; int[] arr=new int[A.length]; for (int i = 0; i < A.length; i++){ for (int j = 0; j < A[i].length; j++){ if (A[i][j] < min…
-3
votes
1 answer

How to check if a binary tree has mirror symmetery in its stucture (not values)

I am asked to write a recursive algorithm which checks if a binary tree has mirror symmetry in its structure (not values). For example: 1 / \ / \ / \ 3 5 / \ / \ 7 9 11 13 / \ 15 …
mohelt
  • 55
  • 2
  • 6
-5
votes
1 answer

Java boolean isSymmetric

for now I have to write a java boolean isSymmetric () fucntion that returns true if the invoking matrix is a symmetric matrix; otherwise it returns false. Can anyone help me with the code here or from where to start? Any answer will be appreciated.
Mina Hafzalla
  • 2,681
  • 9
  • 30
  • 44
-9
votes
1 answer

Why R claims: "Error in if (S[i, j] == S[j, i]) { : missing value where TRUE/FALSE needed ? Symmetric Matrix

Here is my code: Sip<-function(S,u,v){ S<-matrix(,u,v);u<-nrow(S);v<-ncol(S);u==v; for(i in 1:u) {for(j in 1:v){ if(S[i,j]==S[j,i]){print("Simétrica")} else{print("No simétrica")} } } S } Sip(S,2,2) My error is…
1 2 3
11
12