Consider the following algorithm, where the array A is indexed 1 through n:
int add_them ( int n , int A[ ] ) {
index i , j , k ;
j = 0 ;
for ( i = 1 ; i <= n ; i++)
j = j + A[i] ;
k = 1 ;
for ( i = 1 ; i <= n ; i++)
k = k + k ;
return j + k ;
}
(a) If n = 5 and the array A contains 2, 5, 3, 7, and 8, what is returned?
(b) What is the time complexity T(n) of the algorithm?
What is meant by a * search algorithm?
What is the depth-first search algorithm?
Given a series of positive integers. Design an efficient algorithm that can detect pairs whose sum is equal to K such that K = ei + ej, and (i not equal to j).
Tell us how will you know which machine learning algorithm to choose for your classification problem?
What is Back propagation in Neural Networks?
What is greedy best first search algorithm?
Give an algorithm for the following problem. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is minimized. You may assume that n is a multiple of 2.
Tell me how do you choose an algorithm for a classification problem?
What is bidirectional search algorithm?
There are numbers from 1 to n, which are inverted such that it results in numbers from n to 1. If only two consecutive numbers are stampled at a time and are inverted, how many moves are required?
What is simulated annealing algorithm?
Can you pick an algorithm. Write the psuedo-code for a parallel implementation?