1.

When we realize a specific implementation of a pancake algorithm, every move when we find the greatest of the sized array and flipping can be modeled through __________(a) Combinations(b) Exponential functions(c) Logarithmic functions(d) PermutationsI have been asked this question in an internship interview.This key question is from Pancake Sort topic in portion Sorting of Data Structures & Algorithms II

Answer»

Right answer is (d) PERMUTATIONS

Explanation: Here when we FLIPPING the array or stack, we have to take utmost priority to preserve the order of the list so that that sorting doesnt BECOME INVALID. Hence we use permutations, we are ensuring that order MATTERS.



Discussion

No Comment Found

Related InterviewSolutions