Consider the following algorithm:
for ( i = 2 ; i <= n ; i++) {
for ( j = 0 ; j <= n) {
cout << i << j ;
j = j + floor(n/4) ;
}
}
(a) What is the output when n = 4
(b) What is the time complexity T(n). You may assume that n is divisible 4.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More AI Algorithms Interview Questions

When an algorithm is considered completed?

0 Answers  


Tell briefly about the Banker's algorithm and what is it used for?

0 Answers   Impetus,


What is the iterative deepening depth-first search algorithm?

0 Answers  


Which is the most straight forward approach for planning algorithm?

0 Answers  


Tell us why is naïve bayes machine learning algorithm naïve?

0 Answers  






What are the disadvantages of depth-first search algorithm?

0 Answers  


Name search algorithm technology?

0 Answers  


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?

1 Answers   IBM, TCS,


What features would you use to build a recommendation algorithm for users?

0 Answers   Twitter,


What is informed (heuristic) search strategies algorithm?

0 Answers  


How are the k-nearest neigh-bors (knn) algorithms different from k-means clustering?

0 Answers  


Which algorithm is used for solving temporal probabilistic reasoning?

0 Answers  


Categories