Give an example of an O (n) algorithm and O (n*n) algorithm such that the algorithm is slower.


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

Post New Answer

More AI Algorithms Interview Questions

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  


Which algorithm in ‘unification and lifting’ takes two sentences and returns a unifier?

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  


what is software cycle?give a diagramatic representation

0 Answers  


What is meant by a * search algorithm?

0 Answers  


What is simulated annealing algorithm?

0 Answers  


Name search algorithm technology?

0 Answers  


Which language is used for artificial intelligence?

0 Answers   Flextronics,


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

0 Answers   Impetus,


Why size of integer depends on the machine architecture then what the best sorting algorithm and why?

0 Answers   HPCL, Hughes Systique Corporation,


Define Routing Algorithm?

0 Answers   Maveric,


Given a sorted array of n integers that has been rotated i(unknown) number of times, give a (log n) algorithm that finds an element in the array.

0 Answers   Expedia,


Categories
  • AI Algorithms Interview Questions AI Algorithms (74)
  • AI Natural Language Processing Interview Questions AI Natural Language Processing (96)
  • AI Knowledge Representation Reasoning Interview Questions AI Knowledge Representation Reasoning (12)
  • AI Robotics Interview Questions AI Robotics (183)
  • AI Computer Vision Interview Questions AI Computer Vision (13)
  • AI Neural Networks Interview Questions AI Neural Networks (66)
  • AI Fuzzy Logic Interview Questions AI Fuzzy Logic (31)
  • AI Games Interview Questions AI Games (8)
  • AI Languages Interview Questions AI Languages (141)
  • AI Tools Interview Questions AI Tools (11)
  • AI Machine Learning Interview Questions AI Machine Learning (659)
  • Data Science Interview Questions Data Science (671)
  • Data Mining Interview Questions Data Mining (120)
  • AI Deep Learning Interview Questions AI Deep Learning (111)
  • Generative AI Interview Questions Generative AI (153)
  • AI Frameworks Libraries Interview Questions AI Frameworks Libraries (197)
  • AI Ethics Safety Interview Questions AI Ethics Safety (100)
  • AI Applications Interview Questions AI Applications (427)
  • AI General Interview Questions AI General (197)
  • AI AllOther Interview Questions AI AllOther (6)