1. Consider the following algorithm:
for ( i = 1 ; i <= 1 . 5 n ; i++)
cout << i ;
for ( i = n ; i >= 1 ; i - - )
cout << i ;
(a) What is the output when n = 2, n = 4, and n = 6?
(b) What is the time complexity T(n)? You may assume that the input n is divisible by 2.


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

Post New Answer

More AI Algorithms Interview Questions

What is iterative deepening depth-first search algorithm?

0 Answers  


Define Routing Algorithm?

0 Answers   Maveric,


Can you pick an algorithm. Write the psuedo-code for a parallel implementation?

0 Answers  


What is bidirectional search algorithm?

0 Answers  


Which algorithm is used for solving temporal probabilistic reasoning?

0 Answers  






What is Back propagation in Neural Networks?

1 Answers  


Tell me how do you choose an algorithm for a classification problem?

0 Answers  


What’s your favorite algorithm, & can you explain it into me in less than a minute?

0 Answers  


Name search algorithm technology?

0 Answers  


Which language is used for artificial intelligence?

0 Answers   Flextronics,


What is meant by uniform cost search algorithm?

0 Answers  


What are disadvantages uniform cost search algorithm?

0 Answers  


Categories