分而治之方法還可以用于實(shí)現(xiàn)另一種完全不同的排序方法,這種排序法稱為快速排序(quick sort)。在這種方法中, n 個(gè)元素被分成三段(組):左段l e f t,右段r i g h t和中段m i d d l e。中段僅包含一個(gè)元素。左段中各元素都小于等于中段元素,右段中各元素都大于等于中段元素。因此l e f t和r i g h t中的元素可以獨(dú)立排序,并且不必對(duì)l e f t和r i g h t的排序結(jié)果進(jìn)行合并。m i d d l e中的元素被稱為支點(diǎn)( p i v o t )。圖1 4 - 9中給出了快速排序的偽代碼
A Java virtual machine instruction consists of an opcode specifying the operation to be performed, followed by zero or more operands embodying values to be operated upon. This chapter gives details about the format of each Java virtual machine instruction and the operation it performs.
A Java virtual machine instruction consists of an opcode specifying the operation to be performed, followed by zero or more operands embodying values to be operated upon. This chapter gives details about the format of each Java virtual machine instruction and the operation it performs.
A Java virtual machine instruction consists of an opcode specifying the operation to be performed, followed by zero or more operands embodying values to be operated upon. This chapter gives details about the format of each Java virtual machine instruction and the operation it performs.