User talk:Rsathish

Welcome to Wikipedia
Hi! welcome to Wikipedia!

Hope you enjoy contributing to Wikipedia. Be bold in editing pages. Here are some links that you might find useful:


 * Try the Tutorial. If you have less time, try How to edit a page.
 * To sign your posts (for eg. on talk pages) use 	 ~  (four tildes). This will insert your name and timestamp. To insert just your name, type (3 tildes).
 * You can experiment in the Sandbox.
 * For help, see Where to ask a question.
 * Some other pages that will help you know more about Wikipedia: Manual of Style and Five pillars, Neutral point of view, Civility, What Wikipedia is not
 * You can contribute in many ways: write a great article, fight vandalism, upload pictures, perform maintainance tasks, contribute to existing projects...

I hope you stick around and keep contributing to Wikipedia. Drop us a note at New user log.

-- utcursch | talk

P.S. Wikipedia is not a place to publish your Original Research.

Best Sort
It is an innovative o(n) sort with o(n) memory requirements It is a non-comparison sort which optimizes bin sort at bit level Best Sort is bin sort with a bin size of 1 bit, where all possible bits are arranged as tree. The inputs 1,12,1234,12345 will consume 5 bits only. As 1-&gt;2-&gt;3-&gt;4-&gt;5 is the storage structure. Sorting is similar to bin sort, where a scan of all entries are made, entries are inserted into bins and then bins are read out. <P><FONT FACE="Albany"><FONT SIZE=4>Code listing with documentation:</FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>import java.util.Stack;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>/**</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* @author R.SATHISH</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* email: callbabusats@yahoo.co.in</I></FONT></FONT></P> <P> <FONT FACE="Albany"><FONT SIZE=4>* Characteristics:</FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Insert = o(bits in a key) = o(l) for a given key, but much less processing = o(ln)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Print = o(bits in a key) and recursive printing = o(ln)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Memory = every bit stores pointers to its children = o(n(rp+1)l), rp+1 is constant = o(constant*nl)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* = o(ln) = Memory consumption is proportional to 'n' and 'l'</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P> <FONT FACE="Albany"><FONT SIZE=4>* Data Structure description:</FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* The data structure applies universe restricted sort as &quot;Every bit in the key points to all possible next bits.&quot;</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Hence BestTree3 is a highly optimal strategy of universe restricted sort.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 1234</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 1235</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* is stored as</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 1-&gt;2-&gt;3-&gt;4</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*      3-&gt;5</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Memory required is o(bits), but every bit requires o(radix) references.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Hence total memory per key is o(lr) ~ o(l)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Memory required is dependent on radix,length and number of elements.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* To store a 10digit 4-byte unicode string, per bit 2^32 sized array is required. (=640 refernces per key).</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* To store same key in binary requires</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* -conversion to binary string of 32*10 = 320 digits and 2 references per digit. (=640 refernces per key).</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* While insertion and printing are dependent on the number of digits linearly.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Hence it is advisable to perform the sort with maximum radix.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Applications could parallely convert from one radix to another in first thread, </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* and feed the data to BestSort in second Thread. Similarly when second thread prints the sorted keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* first thread could convert to desired radix.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* This strategy will work very efficiently in 2-CPU machine.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* As, to insert/print binary key requires 320 operations, while to insert/print unicode requires 10 operations.</I></FONT></FONT></P> <P> <FONT FACE="Albany"><FONT SIZE=4>* Applications:</FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* All sorts with adequate memory availability. </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Performs well in PCs. Gives o(1) outputs while consuming tens of MB.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Ideal for sorting decimals.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P> <FONT FACE="Albany"><FONT SIZE=4>* Innovative breakthrough sorting algorithm which offers</FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 1.o(ln) insertion o(t) in variable width keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 2.o(n) memory consumption. o(t) in variable width keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 3.o(ln) printing o(t) in variable width keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 4.Handles keys in any radix.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 5.Handles keys of any length (keys need not be constant width)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Prior Art</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* None</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> </FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* @throws java.lang.OutOfMemoryError</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*/</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>public class BestTree3 implements BestTree{</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	class RadixBit {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		RadixBit children[] = null;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		boolean hasChild = false;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		RadixBit {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			super;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			children = new RadixBit[radix];</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		RadixBit at(int at) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			return (RadixBit) children[at];</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		boolean get(int at) {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			return children[at] != null;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		public boolean isHasChild {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			return hasChild;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		RadixBit set(int at) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			if (get(at)) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>				return at(at);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			}</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			hasChild = true;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			RadixBit child = new RadixBit;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			children[at] = child;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			return child;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		public void setHasChild(boolean hasChild) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			this.hasChild = hasChild;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	int keyL;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	int radix;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	RadixBit root = null;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	BestTree3(int radix, int keyL) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		this.radix = radix;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		this.keyL = keyL;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		root = new RadixBit;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	public void insert(int[] key) {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		RadixBit last = root;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		for (int i = 0; i &lt; key.length; i++) {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			last = last.set(key[i]); // Every bit is set once. Hence o(1).</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			//Please note the difrence from bin sort, where sorting is done 'k'</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			// times...</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			//Here insertion is done once per bit per key..i.e we write to a</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			// magic box once</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			//and read from the magic box to see sorted results in o(n).</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	public void print {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		print(root, &quot;&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	//Stack stack = new Stack;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	private void print(RadixBit last, String prefix) {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		int i = 0;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		for (i &lt; radix; i++) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			if (last.get(i)) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>				print(last.at(i), prefix + &quot;.&quot; + i); // Every key is printed</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>													 // once. Hence o(1);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		if (last.isHasChild == false) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			//System.out.println(prefix);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>}</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>/**</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* @author R.SATHISH</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* email:callbabusats@yahoo.co.in</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Insert = o(n),o(in),o(rn)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Print = o(n),o(in),o(rn)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Memory = o(r^(l+1)),o(r^l),o(nl)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*/</I></FONT></FONT></P> <P><BR><BR> </P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>public interface BestTree {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* print writes the keys in sorted order to standard output.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Few versions write per bit while others per key.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*/</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	public void print;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* insert reads and includes the key to the data store.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Few versions of insert convert the key to an intermediate radix.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Few versions compute the value of the key from its digit and work at key level.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* @param key Digits of key with MSB in 0 in the required radix.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*/</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	public void insert(int key[]);</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>}</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>/**</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* @author R.SATHISH</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* email:callbabusats@yahoo.co.in</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P> <FONT FACE="Albany"><FONT SIZE=4>* Symbols:</FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 'n' - Number of keys to be sorted</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 'r' - radix of keys digits</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 'l' - width of a key (assumes constant width zero padded keys)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 'p' - Pointer size</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 'i' - internal radix</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 'c' = ln-i(r)</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* 't' = Number of digits in all keys = ln in constant width keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* This Java class demonstrates O(ln) capabilitis of best sort. This class is the</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* core patentable sorting algorithm.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Step 1 - Creates a data store for the keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Step 2 - Accepts keys and inserts into the data store</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Step 3 - Prints out the sorted keys</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* This is Version 1 of Best Sort.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Prior art:</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Best Sort is an innovation without precdence.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* It comes under distribution sort, universe restricted sort.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Best sort is a &lt;b&gt;single pass&lt;/b&gt; sort.All best sorts sort the data only once.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* But few versions, sort per bit, while few per key.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Few versions require exponential memory, while others linear memory.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* &lt;b&gt; The simulations show that Javas quick sort outperform Best Sort.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* (This version of Best Sort is not the most optimal implementation).</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* But Best Sort provides o(ln) sorting while quick sort o(nlogn). </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* Best sort outperforms quick sort when number of keys are exponentially greater than number of digits.</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* &lt;/b&gt;</I></FONT></FONT></P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>* </I></FONT></FONT> </P> <P><FONT COLOR="#800000"> <FONT SIZE=2><I>*/</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>import java.util.*;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>public class BestSort {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	public static void main(String[] args) {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 * Command line parsing section.</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 */</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		if (args.length != 3) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			System.out.println(&quot;Usage:java BestSort radix keyLength count&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			return;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 * Initalisation section</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 */</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		int radix = Integer.parseInt(args[0]);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		int l = Integer.parseInt(args[1]);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		int count = Integer.parseInt(args[2]);</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 * Creates the Best Tree Data Structure which supports Best Sort.</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 */</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		BestTree tree1 = new BestTree32(radix, l);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		BestTree tree2 = new BestTree3(radix, l);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		BestTree tree3 = new BestTree3(radix, l);</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		int arr[] = new int[l];</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		long ins1,ins2,ins3,st,ins0;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		ins1=ins2=ins3=0;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		String conv[] = new String[count];</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 * Insertion section.</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 */</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		for (count &gt; 0; count--) {</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			StringBuffer str = new StringBuffer(l);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			for (int k = 0; k &lt; l; k++) {</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>				arr[k] = (int) (Math.random * radix); // Randomly generates key digits</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>				str.append('0'+arr[k]);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			conv[conv.length-count] = str.toString;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			tree1.insert(arr);// o(l) insertion</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			ins1 += System.currentTimeMillis -st;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>			</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			tree2.insert(arr);// o(l) insertion</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			ins2 += System.currentTimeMillis -st;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			tree3.insert(arr);// o(l) insertion</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//			ins3 += System.currentTimeMillis -st;</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		/*</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 * Sorted output printing section.</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		 */</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		System.out.println(&quot;Java Arrays.sort......&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		Arrays.sort(conv);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		st = System.currentTimeMillis - st;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		System.out.println(&quot;executed in &quot;+(st)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		System.out.println(&quot;BestSort1......&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		tree1.print;//o(n) printing</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		st = System.currentTimeMillis - st;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		System.out.println(&quot;executed in &quot;+(st+ins1)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		System.out.println(&quot;Inserted in &quot;+(ins1)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		System.out.println(&quot;Printed in &quot;+(st)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;BestSort2......&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		tree2.print;//o(n) printing</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		st = System.currentTimeMillis - st;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;executed in &quot;+(st+ins2)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;Inserted in &quot;+(ins2)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;Printed in &quot;+(st)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;BestSort3......&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		st = System.currentTimeMillis;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		tree3.print;//o(ln) printing</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		st = System.currentTimeMillis - st;</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;executed in &quot;+(st+ins3)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;Inserted in &quot;+(ins3)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>//		System.out.println(&quot;Printed in &quot;+(st)+&quot; ms&quot;);</I></FONT></FONT></P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>	}</I></FONT></FONT></P> <P><BR><BR> </P> <P><FONT COLOR="#800000"><FONT SIZE=2><I>}</I></FONT></FONT></P> <P><BR><BR> </P>

Nomination of Private class data pattern for deletion
A discussion is taking place as to whether the article Private class data pattern is suitable for inclusion in Wikipedia according to Wikipedia's policies and guidelines or whether it should be deleted.

The article will be discussed at Articles for deletion/Private class data pattern until a consensus is reached, and anyone, including you, is welcome to contribute to the discussion. The nomination will explain the policies and guidelines which are of concern. The discussion focuses on high-quality evidence and our policies and guidelines.

Users may edit the article during the discussion, including to improve the article to address concerns raised in the discussion. However, do not remove the article-for-deletion notice from the top of the article. Boleyn (talk) 12:46, 7 August 2021 (UTC)