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 & ...)
Pseudocode
CheckArrayPalindrome(A, n)
START
DECLARE Flag =
false
DECLARE i =
0
WHILE (i
<= n/2 and n != 2)
IF (A[i] != A[n - i - 1])
Flag = true;
break;
i += 1;
IF Flag ==
1
PRINT "NO"
Else
PRINT "YES"
END

Write a pseudo code of an algorithm that returns "yes" if the input array (contains integers)...
(a) Give the pseudo-code for a recursive algorithm called Find_Smallest(A, n) that returns the value of the smallest element in an array of n integers called A. Assume the elements in the array are at locations A[1]..A[n]. (b) Give a recurrence T(n) for the running time of your algorithm. (c) Solve the recurrence in part (b)
java code
Write a method called reverse that takes an array of integers as an input and returns the same values in reverse order as the output. Test your method in the main.
Design an algorithm for the following description. Solution can
be done in pseudo-code or steps of the algorithm.
Describe and analyze an algorithm that takes an unsorted array A of n integers (in an unbounded range) and an integer k, and divides A into k equal-sized groups, such that the integers in the first group are lower than the integers in the second group, and the integers in the second group are lower than the integers in the third group,...
Code in C++ please! Write a function that takes an array of integers as an input parameter (the address of the first value of the array). It returns nothing. It prints out the array as a single line, with commas between each number, and when the array is finished being printed, it prints an endl; so that we flush the buffer and move to a new line. (I’m having you write this function because you’ll be wanting to print out...
Individually or in pairs, please write pseudo-code to solve the following problems and state which Big-θ category the algorithm belongs to (you don’t have to prove it). An array, A[0…n-2], contains n-1 integers from 0 to n-1 in increasing order – one integer is missing in the range. Design the most efficient algorithm you can to find the missing integer. You have an unsorted sequence of college applications in an array, A[0…n-1]. Each application A contains a name A.name, an...
Question 4 6 points You have to design an algorithm that verify if an array contains duplicate values. This algorithm simply returns true as soon as two identical values are found. To perform this task you must not change the order of the elements in the array (so you cannot sort it) or use an auxiliary array. Write the pseudo-code of this algorithm and give the Big-2 complexity in the worst case.
Write a Java program that reads a 1D array of integers from standard input and returns it.
Write a recursive algorithm in a pseudo code, Min-Max, for finding both the minimum and the maximum elements in an array A of n elements. Your algorithm calls itself only once within the algorithm and should return a pair (a, b) where a is the minimum element and b is the maximum element.
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...
Discrete Mathematics
22. Let r be a relation on the integers such that (a, b) E r if and only if a +b 1. What is the transitive closure of r? 23. Write an algorithm in pseudo code that converts numbers in decimal representation to octal (base 8) representation 24. Prove that the set of integers in countable
22. Let r be a relation on the integers such that (a, b) E r if and only if a +b 1....