I need to determine if my array is unique and in ascending


I need to determine if my array is unique and in ascending order. I've got the ascending order part figured out but am not sure that I'm doing the unique part correctly. Could you check my pseudocode to see if I have it right? I not, please give me direction on how to do this.

Enter
Read N
SUB = 0
VALID_TABLE = 'Yes'
UNIQUE_TABLE = 'Yes'
DOWHILE SUB <= N
SUB = SUB + 1
Read A(SUB)
IF A(SUB-1) > A(SUB) THEN
VALID_TABLE = 'No'
ELSE
IF A(SUB) = A(SUB+1) THEN
UNIQUE_TABLE = 'No'
(ELSE)
ENDIF
ENDIF
ENDDO
Return

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: I need to determine if my array is unique and in ascending
Reference No:- TGS01254936

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)