Develop an algorithm in a flow chart and pseudo code to calculate the sum of sequence of a given input of numbers
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
Develop an algorithm in a flow chart and pseudo code to calculate the sum of sequence of a given input of numbers
Write pseudo code to solve problem: Read a sequence of N given numbers and calculate the sum of the terms located before the first “8” in the sequence.
need help in this algorithm question
Let A be an array containing n numbers (positive and negative). Develop a divide and conquer algorithm that finds the two indices 1 sisjsn such that A[k] (the sum of the elements from i to j) is maximized. For example, in the array A [10,-5,-6,5, 7,-2,4, -11], the sub-array A[4:6] has the sum 5+ 7-2+4-14 and no other sub-array contains elements that sum to a value greater than 14, so for this input the...
1-Write an algorithm to get two numbers from the user (as inputs) and calculate the sum of two numbers and print out the result. (draw the flow chart) 2-Write an algorithm to get a number from the user and calculate the square of that number and print out the result.
ALGORITHM PROBLEM: A) Significant Inversions: We are given a sequence of n arbitrary but distinct real numbers <a1 , a2 ,..., an>. We define a significant inversion to be a pair i < j such that ai > 2 aj . Design and analyze an O(n log n) time algorithm to count the number of significant inversions in the given sequence. [Hint: Use divide-&-conquer. Do the “combine” step carefully] B) The Maximum-Sum Monotone Sub-Array Problem: Input: An array A[1..n] of...
Title Algorithms Functional Requirements and Marks using c++ Write a pseudo-code algorithm for the following problems: Detect if three angles can make a triangle. (1) Hint: In a triangle, the sum of all angles is 180. Switch the value of two numbers (1) If a=2 and b=5, we want to have a=5 and b=2 at the end. Remember that a=b will result in the old value to of a to get lost. Receive a set of numbers and find...
NU library is planning to develop an automated system to calculate the fines of the late returned books. Develop a system to help the university to complete the task based on the given details: Numbers of days Amount of fine 300 biza 350 biza More than 3 but less than or equal to 5 400 biza 450 biza 400 biza More than 5 but less than or equal to 7 450 biza Template A DEAD 2801/2019 500 biza 550 biza...
07-15 pts) Develop a recursive version of the Bubble Sort algorithm. (a) Write the pseudo code of the algorithm and justify that it is recursive and works correctly Write the recurrence relation for the algorithm and solve it using one of the two approaches discussed in class, as appropriate. Solve the recurrence relation and show that the time complexity of the recursive algorithm is θ(n).
Exercise 7.3.5: Worst-case time complexity - mystery algorithm. The algorithm below makes some changes to an input sequence of numbers. MysteryAlgorithm Input: a1, a2....,an n, the length of the sequence. p, a number Output: ?? i != 1 j:=n While (i < j) While (i <j and a < p) i:= i + 1 End-while While (i <j and a 2 p) j:=j-1 End-while If (i < j), swap a, and a End-while Return( aj, a2,...,an) (a) Describe in English...
Write a pseudo code of an algorithm that returns "yes" if the input array (contains integers) is a palindrome, and no if it is not (means first item is the same as last one, second one is the same as second from the last & ...)