Question: Write an algorithm in PSEUDOCODE (NOT A PROGRAMMING LANGUAGE CODE LIKE C++) or Nassi-Schneidermann-diagram We encoded a one-part music with positive integers (1..88). The code

Write an algorithm in PSEUDOCODE (NOT A PROGRAMMING LANGUAGE CODE LIKE C++) or Nassi-Schneidermann-diagram

We encoded a one-part music with positive integers (1..88). The code indicates the height of the sound. 0 is the unit long break.

The length of a sound is given as a positive number that specifys the height of that sound + (length-1)*100 (length=1.2,...). E.g. 60-pitch sound lasting up to 2 time units: 60+100=160.

Look for an M-length repeating pattern in N-note music. Enter the repeating pattern with the index of their first occurrence.

EXAMPLE TASK (the solution should be similar like in the example):

Task: On a railway line, a train conductor at each station recorded how many people boarded the train. Enter a station where more people took off than at the previous station, but both had take-offs. (Input, output, prerequisite, algorithm)!

Solution:

Input: n-->N, A-->Nn

Output: Exists-->L, S-->N

Prerequisite: n>2

Name of the algorithm: linear search algorithm

Algorithm (Nassi-Schneidermann-Diagram OR pseudocode, the diagram represents sequences, loops and else-if statements, so pseudocode written solutions are also good!)

Write an algorithm in PSEUDOCODE (NOT A PROGRAMMING LANGUAGE CODE LIKE C++)

i:=2 i=0 s A[i-1]>0 s A[i]>A[i-1]) i:=i+1 Exists:=i0 s A[i-1]>0 s A[i]>A[i-1]) i:=i+1 Exists:=i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!