The outer loop for the number of elements and the inner loop for the number of arraylists.
Monica. Shiralkar wrote:Also I do not have 1 or 2 but 30 arrayLists.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Monica. Shiralkar wrote:in hadoop
the mapper emits key value pair and each value is arrayList of values against a given key..So once we have 30 arrayList how to proceed.Iterating one within another is not feasible solution.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
The first thing to do is to change your code from dealing with individual arraylist variables to dealing with a collection of arraylists eg a List or array of arraylists and then you iterate over that.
So, why not just process each ArrayList as it comes in? Or is there some other reason that makes you think that you need to gather them all together first?
Monica. Shiralkar wrote:
Now suppose I have an array of arrayLists say 30 arrayLists.How do I Iterate the arrayList to get top 1 of each arrayList,then top 2 of each arrayList and so on? How would 1 iterator do that?
Monica. Shiralkar wrote: I am taking myArrayList.get[0] and summing all,next I am doing myArrayList.get[1] and sum all. This way it should work hopefully.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Don't get me started about those stupid light bulbs. |