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

  Cost control techniques

Assume your company has just completed the Initiation Process for implementing an Email System Upgrade. It was identified in a recent meeting with management leaders from the Sales,

  Describe a polynomial time algorithm

Describe a polynomial time algorithm that solves the following decision problem: Given a graph G and an edge f in it, does G have a cycle containing f?

  Cuckoo hashing

Using Cuckoo hashing, hash the following keys using the (h1,h2) pairs shown. A: 2,0 B: 0,0 C: 4,1 D: 0,1 E: 2,3 Using Hopscotch hashing with a max hop of 4, hash the following keys. A: 6 B: 7 C: 9 D: 7 E: 6 F: 7 G: 8

  Design benefits election system-service request from huffman

Individual project for this course is in form of Service Request from Huffman Trucking. It is essential for student to access Service Request: SR-ht-001. Design a Benefits Election System.

  Let t be the degree of a btree

Let t be the degree of a BTree. Suppose the size of each object, including the key, stored in the tree is 90 bytes. Also, suppose the size of a BTreeNode pointer is 4 bytes.

  How much time can elapse in the given algorithm

How much time can elapse in Algorithm 16.3 between a crash and its detection? Prove the eventual perfection of Algorithm 16.4. Is the re­ lation mep J.t eventually satisfied in every execution?

  Question about binomial tree

A binomial tree of height O, Bo is a one node tree. A binomial tree of height k, Bk is formed through attaching a binomial tree, Bk-1 to root of another binomial tree another binomial tree Bk-1.

  Write down the data list which results from the

question 1. what numbers are compared to 72 if sequential search is used 2 5 7 9 11 17 18 21 28 30 45 54 65 69 72. also

  Describe a method for over tting-avoidance

Which would be chosen as the \best" attribute by a decision tree learner using the information gain splitting criterion and describe a method for over tting-avoidance in decision tree learning.

  System analyst

A huge, well regarded supplier of key raw materials to your corporation's production process requires a year-end summary report of totals purchased from it.

  Maekawa''s algorithm

Maekawa's Algorithm is used to achieve mutual exclusion for 13 sites. Suppose the sites are labeled 1, 2, ..., 13. Find the request sets R1, R2, ... , R13. Suppose sites 1, 6, 12 want to enter a critical section ( CS ) and they have sent requests in ..

  Write height-balanced tree code with backpointers

Write height-balanced tree code with backpointers, based on the height-balanced tree code - The programming language is C or C++; test your code before submission using the gcc or g++ compiler.

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