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

What is meant by a * search algorithm?

0 Answers  


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.

0 Answers  


Draw a flowchart to find the average of four number?

0 Answers  


Give a general algorithm for converting a m-array tree to a 2-ary tree.

0 Answers   Tech Mahindra,


Which search algorithm will use a limited amount of memory in an online search?

0 Answers  






Consider the following algorithm: j = 1 ; while ( j <= n/2) { i = 1 ; while ( i <= j ) { cout << j << i ; i++; } j++; } (a) What is the output when n = 6, n = 8, and n = 10? (b) What is the time complexity T(n)? You may assume that the input n is divisible by 2.

1 Answers  


What is bidirectional search algorithm?

0 Answers  


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

0 Answers   Twitter,


What is Back propagation in Neural Networks?

1 Answers  


What is depth-first search algorithm?

0 Answers  


Which search algorithm will use a limited amount of memory in online search?

0 Answers  


What is the uniform cost search algorithm?

0 Answers  


Categories