Method and apparatus for element selection exhausting an entire array
AssigneeSun Microsystems, Inc.
InventorPeter van der Linden
Life of this patent
Estimating the term…
Abstract
Methods and apparatus for element selection exhausting an entire array are disclosed. A method for processing an array having a plurality of elements includes selecting one of the plurality of elements. An index is maintained dividing the array into a first section containing each selected one of the plurality of elements and a second section containing each unselected one of the plurality of elements. The selected one of the plurality of elements is then swapped with an unprocessed element in the array such that the selected one of the plurality of elements is stored in the first section of the array. The selected one of the plurality of elements may then be processed.
Claims13
A method for processing an array having a plurality of storage locations, each one of the plurality of storage locations being capable of storing an array element, the method comprising:
- (a) selecting a first array element in the array;
- (b) swapping the selected first array element with an array element located in a first storage location;
- (c) processing the first selected element;
- (d) selecting another array element in the array which has not been previously selected;
- (e) swapping the selected another array element with an array element located in a next storage location that is located adjacent the storage location of the previously selected array element;
- (f) processing the selected another array element;
- and
- (g) repeating steps (d)-(f) for additional array elements in the array, wherein each swapping step is performed only after each corresponding processing step.
A method for processing an array having a plurality of elements, comprising:
- selecting one of the plurality of elements;
- maintaining an index dividing the array into a first section containing each selected one of the plurality of elements and a second section containing each one of the plurality of elements that remain to be selected;
- swapping the selected one of the plurality of elements with one of the plurality of elements that remain to be selected such that the selected one of the plurality of elements is stored in the first section of the array;
- and
- processing the selected one of the plurality of elements, wherein said swapping step is performed only after said processing step.
A computer-readable medium recording software, the software disposed on a computer to perform a method for processing an array having a plurality of elements, the method comprising:
- selecting one of the plurality of elements;
- maintaining an index dividing the array into a first section containing each selected one of the plurality of elements and a second section containing each unselected one of the plurality of elements;
- swapping the selected one of the plurality of elements with an unselected element in the array such that the selected one of the plurality of elements is stored in the first section of the array;
- and
- processing the selected one of the plurality of elements, wherein said swapping step is performed only after said processing step.
A computer system for processing an array having a plurality of elements, the computer system comprising:
- a processor;
- and
- a memory having stored therein the following:
- a module for selecting one of the plurality of elements;
- a module for maintaining an index dividing the array into a first section containing each selected one of the plurality of elements and a second section containing each unselected one of the plurality of elements;
- a module for swapping the selected one of the plurality of elements with an unprocessed element in the array such that the selected one of the plurality of elements is stored in the first section of the array;
- and
- a module for processing the selected one of the plurality of elements, wherein said swapping step is performed only after said processing step.
Dependencies are inferred from the claim text.