Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions