×

Multi-interval quicksort algorithm for complex objects

  • US 9,129,004 B2
  • Filed: 11/12/2008
  • Issued: 09/08/2015
  • Est. Priority Date: 11/12/2008
  • Status: Active Grant
First Claim
Patent Images

1. A computer implemented method for sorting an array of elements, the method comprising the steps of:

  • receiving a sort request from a requesting entity that includes sorting criteria for the array of elements, wherein the elements are stored in memory that is accessible by a processor, and wherein the elements consist of references to complex objects stored in memory;

    operating the processor to run a sorting module to sort the elements from a first order to a second order differing from the first order to form a sorted array;

    wherein the elements are sorted dependent on the sorting criteria, the sorting criteria including a characteristic of the complex objects, and the sorting of the elements being performed by accessing the complex objects in the memory and by comparing the characteristics of corresponding ones of the complex objects stored in the memory; and

    storing the sorted array of elements in a memory,wherein the forming of the sorted array by the sorting module includes the steps of;

    selecting at least two of the elements as pivot elements; and

    sorting the elements in the array using the at least two pivot elements as initially sorted elements of the second order defining the sorted array, andwherein the sorting step comprises;

    comparing the pivot elements with each other to determine a sort order for the pivot elements relative to each other;

    creating a plurality of empty sub-arrays that each correspond to a sorting interval relative to the pivot elements, such that the number of sub-arrays created is one more than the number of pivots;

    determining the relative sorting position of each of the non-pivot elements in the array with respect to the pivot elements; and

    dependent upon the determining, inserting each non-pivot element of the array into a corresponding one of the plurality of sub-arrays.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×