Logo 
Search:

C Programming Forum

Ask Question   UnAnswered
Home » Forum » C Programming       RSS Feeds

Write a C program that shall perform sort 10 numbers using insertion sort and stack operation.

  Asked By: Yshobelle    Date: Sep 22    Category: C Programming    Views: 23535
  

Write a C program that shall perform sort 10 numbers using insertion sort and stack operation.If memory storage is full, remove data by queue operations. Use arrays and use linked list in another program with the same problem.

This must be the output
(sample 5 numbers in data):

Enter a number: 5
Push 5
Stack Data: 5
Enter a number: 3
Pop 5
Push 3
Push 5
Stack Data: 3 5
Enter a number: 8
Push 8
Stack Data: 3 5 8
Enter a number: -12
Pop 8
Pop 5
Pop 3
Push -12
Push 3
Push 5
Push 8
Stack Data: -12 3 5 8
Enter a number: 7
Pop 8
Push 7
Push 8
Stack Data: -12 3 5 7 8
Enter a number: 6
Dequeue
Stack Data: 3 5 7 8
Pop 8
Pop 7
Push 6
Push 7
Push 8
Stack Data: 3 5 6 7 8

Share: 

 

No Answers Found. Be the First, To Post Answer.

 




Tagged: