No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
6 Posted Topics
Hi, synchronized method [CODE] class MyClass{ public void synchronized myMethod(){ //your code } } [/CODE] is the same as [CODE] class MyClass{ public void myMethod(){ synchronized(this){ //your code } } } [/CODE] :-) Andrej
I like to use an open-source implementation of multi-core sorting algorithm from [URL="http://www.happy-guys.com/en/open-source/happy-commons/features/sorting-algorithm.html"]happy-commons[/URL] [CODE] Integer[] a = ...; //sort the array Arrays_1x0.sort(a); [/CODE] :-) Andrej
[QUOTE=hket89;1116956]How to generate a pair of random number from 1 to 8 that can fill into a 2D array in a 4x4 square? For example: 2 3 5 6 1 7 8 3 5 4 1 6 7 2 4 8[/QUOTE] The best way is to use the Random.randomInt(...) method: …
[QUOTE=Namrata.Bibodi;1109525]In which Java's library is binary search tree found ?[/QUOTE] I like [URL="http://commons.apache.org/collections/api-3.2/org/apache/commons/collections/list/TreeList.html"]TreeList[/URL] from apache-collections it implements the java.util.List interface, thus you can use as a List. But it is few times faster as ArrayList if you want to change it.
[QUOTE=checho;1105300]hi i have the next problem i have an array or arraylist from class Student which has firstname, lastname and grade.[/QUOTE] Hi you can use the standard Collections.sort(..) method, but this doesn't use the power of your multi-core mashine. Thus I use the sort-implementation from [URL="http://www.happy-guys.com/en/open-source/happy-collections/summary.html"]happy-collections[/URL] library (Apache License 2.0). …
[QUOTE=alkeshtech;1021937]Hi guys, I am wondering how can I create a sorted linked list, without using Collection.sort(). Is there a way I can add element in a list in a sorted fashion?[/QUOTE] I used the [URL="http://www.happy-guys.com/en/open-source/happy-collections.html"]happy-collections library[/URL] (Apache License Version 2.0) to decorate LinkedList with a SortedList decorator. To increase the …
The End.
Andreas Hollman