answersLogoWhite

0

A stack is implicitly sorted by hierarchical nested order. It does not make sense to sort a stack.

Do you mean a list? If so, please ask the question again.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you write a standard basic program?

That really depends on what sort of program you are trying to build, what do you want the program to do?


In the bubble sort algorithm the second loop iterates ---------- for each of the unsorted array elements?

n-1 times


Write a program in c to sort the details of 10 students using the structure?

for(i = 0; i < num_students; i ++){ sort(student[i]); } That's what you get when you're that specific!


What is the most efficient way to find the median of an unsorted array of numbers?

One efficient way to find the median of an unsorted array of numbers is to first sort the array in either ascending or descending order, then determine the middle value as the median.


Write c program to find median?

If you are using an array : sort using qsort() then take middle element.


How can I efficiently use a stack to sort elements in a data structure?

To efficiently use a stack to sort elements in a data structure, you can follow these steps: Push all elements into the stack. Create a temporary stack to store the sorted elements. While the original stack is not empty, pop an element from the original stack. Compare the popped element with the top element of the temporary stack. If the popped element is greater, push it onto the temporary stack. If the popped element is smaller, keep popping elements from the temporary stack and pushing them back onto the original stack until the temporary stack is empty or the top element is greater. Repeat steps 3-6 until the original stack is empty. The elements in the temporary stack will now be sorted in ascending order. By following these steps, you can efficiently use a stack to sort elements in a data structure.


Do glaciers sort the material they transport?

No. Material that is directly deposited by glaciers, called till, is completely unsorted. However, some of the processes around glaciers, particularly streams from meltwater, can sort material.


A C program using dynamic memory allocation to sort n names in ascending order?

Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.


How do you write an algorithm for list of names in ascending order?

If they're in an array, use java.util.Arrays.sort(). If they're in a Collection, as in java.util.Collection, use java.util.Collections.sort(). If you want an actual algorithm, try a for-each loop with an equivalence operator and conditional switch.


Is there any way to perform quick sort other than stack?

Stack is not a way to perform quicksort, it is a tool used to implement recursion.


Where do you write a story on your computer?

Most computers nowadays come with some sort of word processing program like Microsoft Word - just open that program and follow the directions to get started!


Can you implement merge sort without using recursion?

Sure, recursion can always be substituted with using a stack.