Determine if array is unique and in ascending order

Assignment Help Data Structure & Algorithms
Reference no: EM13945635

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

Reference no: EM13945635

Questions Cloud

Prepare a memo detailing all legislated payments : Prepare a memo detailing all legislated payments on termination of employment for each jurisdiction. In addition to the required payments include any related employer cost.
Pseudocode contains pseudo-code for a program : Pseudocode contains pseudo-code for a program which processes a client file (the master file) and a service file (the transaction file) by updating the clientTotal field in the client file according to the serviceTotal field in the service file.
How can we tell the time from these rocks : How are fossils and sedimentary facies used to provide information to scientists today about life millions of years ago? The specific evidences we can find in the rocks. Iinclude: (a) the "messages" that are left behind in the Earth at that time a..
External factors influencing employee behavior : External factors influencing employee behavior
Determine if array is unique and in ascending order : 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 m..
Differences between available balances and book balances : Motives of holding cash - What are your motives for holding cash and have they changed during this more recent financial crisis? Available vs book balences - What causes the differences between available balances and book balances
Discuss aquaculture and its environmental impacts : What are your recommendations to manage two competing visions for Appalachia's future - Discuss aquaculture and its environmental impacts
Write a function isperfect that returns the boolean true : Write a function isPerfect that takes an inputnas input and returns the boolean true ifn is perfect, and false otherwise.
What scientists hoping to find with new improved telescope : The James Webb Space Telescope is set to launch in the near future. Discuss the advantages that this telescope has over the Hubble Telescope that is currently in operation. What are scientists hoping to find with this new improved telescope?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write a context-free grammar for arithmetic expressions

Transform the context-free grammar obtained in Activity 5 to a pushdown automaton using the algorithm in Section 12.2.2. Turn in your solution by the date when Section 12.3 is finished.

  Algorithm to produce schedule for least completion time

What is the best order for sending people out, if one wants whole competition to be over as early as possible? More precisely, provide efficient algorithm which produces schedule whose completion time is as small as possible.

  What-if and goal-seeking analysis

Problem 1: What-if and Goal-seeking analysis, Problem 2: Portfolio Planning using optimization, Problem 3: A Monte Carlo Simulation Problem

  Determine the sequence of pairwise matrix multiplication

Determine the sequence of pairwise matrix multiplication to use. Show the steps of the algorithm - Bellman-Ford algorithm on this graph. Show the steps of the algorithm.

  Spreadsheet to compute projected total costs and profits

Prepare a spreadsheet to compute your projected total costs, total revenues, and total profits for giving seminar on cost estimating.

  Create a recursive backtracking solution

The columns and rows of the matrix are the regions while the cells contain a 0 if the two regions are not adjacent and a 1 if they border. Create a recursive backtracking solution which accepts as interactive input from the user the number of regi..

  Question about java hashtables

Prompt the user for a string, and display the corresponding number. For example, if the user types "five", the program would output "5". This must be done using the hashtable as created in the previous step.

  Efficient algorithm that achieves goal using base station

So that every house is within four miles of one of the base stations. Write efficient algorithm that achieves this goal, using as few base stations as possible.

  Creating a big inteter calculator program

Create a big-inteter calculator program that permits the user to enter two large integers and the operation to be performed and that calls appropriate function to carry out the designated operation.

  Create tree correspond to expression pre-order traversal

Let the algebraic expression E=(2x+y)(5a-b)^3. Create tree T which correspond to expression E and determine pre-order traversal of T.

  Create an algorithm to describe how to balance a checkbook

Create an algorithm to describe how to balance a checkbook for a company that has more than 100transactions.

  Let sbe the set of all people in the world for a b epsilon

let sbe the set of all people in the world. for a b epsilon s define a binary relation r as follows a b epsilon r if

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd