java


Generating sublists from a list with complexity less than O(n2)


HashSet<String> result=new HashSet();
String str ="";
for (Iterator iter = xyz.iterator(); iter.hasNext();) {
str = // get some String property of the object
result.add(str);
}
List list = null ;
for(String s : result){
list = new ArrayList();
for (Iterator iter1 = xyz.iterator(); iter1.hasNext();) {
if(s.contains(//String property of the object){
list.add();
}
}
//do something with the list
}
xyz is a list of objects.
Here, i am grouping a list of objects based on a particular property.
The code takes long time in worst case scenario. Is it possible to make this code smaller and less complex ?

Related Links

Possible to disable Java autoboxing?
How to go a specific position?
How to improve java nio2 net performance?
Copying a variable number of methods from one place to another in Java
How to combine the KeyUpHandler and the ValueChangeHandler in GWT?
How to disable a button while processing
Tracking multiple presses via libgdx and android
Little Confusion Over Hashing
Multiple buttons with different layouts
Listview with pull to refersh Scroll down to last item when adding header-view
Issues with Image Convolution
GWT - Load a configuration item from context.xml
How to sort this ArrayList by various parameters in Java? [duplicate]
[GAE Java]: WARNING: Not using any credentials
Can you use the Bloomberg API on Android?
Printing the diagnols of the matrix and showin it on the screen so that every value shows exactly where it should be

Categories

HOME
ionic-framework
mediawiki
session
octobercms
cvs
maven-3
twitter-bootstrap-4
survey
ravendb
fancybox
esper
awesome-wm
midi
row
u-sql
correlation
google-cloud-spanner
zend-framework3
spring-tool-suite
static-libraries
hex-editors
telephony
saxon
invantive-sql
zapier
jasonette
core-text
h2db
sqlcipher
shopware
cas
centos6.5
django-storage
bootstrap-duallistbox
entitlements
social-media
assistant
elasticsearch-net
windowbuilder
libssl
preg-match
phonegap
titanium-mobile
stringtemplate
android-kernel
unobtrusive-validation
angularjs-factory
unoconv
grid.mvc
dynamic-reports
arena-simulation
mime
flashair
smartcontracts
hls.js
pebble-watch
elgg
r-forge
sqlbulkcopy
pdfclown
instant
elements
fuzzy-search
persist
ios4
createprocessasuser
nsight
composite
bridge.net
jsapi
cdt
xojo
responsive-slides
reactfx
hyprlinkr
transcoding
mbr
fmod
ms-project-server-2010
dotnetnuke-5
gridcontrol
padarn
mylyn
jelly
free-variable
sublist
bluepill
propertyeditor
qtkit
bubble-chart
whoosh
stage
coercion
iphone-web-app
datareader
google-friend-connect
blitz++
asp.net-mvc-areas
suppress
zend-tool
text-coloring
project-hosting
geneva-server
dbisam
document-conversion

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App