Sorted Array - Applications of Sorted Arrays

Applications of Sorted Arrays

1) Commercial Computing:

Government organisations, private companies and many web based applications have to deal with huge amounts of data. The data will often have to be accessed multiple times. Keeping the data in a sorted format allows for quick and easy recovery of data.

2) In discrete mathematics: Sorted arrays can be used to implement Dijkstra's algorithm or Prim's algorithm. Also, algorithms like Kruskal's Algorithm for finding minimal spanning trees.

3) In priority scheduling: At the operating system level many processes are pending at a time, but CPU can handle only one process at a single instance in time. Therefore, priorities are associated to each process.Then the processes are sent to CPU according to the highest priority by using sorted array of process ID's. Here, processes got sorted depending upon their priorities and then CPU is allocated to them. The process having the highest priority takes first position in sorted array. Hence priority-wise system processes scheduling is done.

4) In Shortest-Job-First Scheduling: This is the special case of priority scheduling. Here, Processes get sorted according to burst time of the processes. The process requiring the shortest time will be allocated CPU first. Hence, Processes are being sent to CPU according to their burst time.

Process Burst time
P1 3
P2 4
P3 1
P4 8
P5 6

Read more about this topic:  Sorted Array

Famous quotes containing the word sorted:

    It hurts the spirit, somehow, to read the word environments, when the plural means that there are so many alternatives there to be sorted through, as in a market, and voted on.
    Lewis Thomas (b. 1913)