RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 2138 | Replies: 2
Reply
Join Date: Jul 2005
Posts: 3
Reputation: roopasumanth is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
roopasumanth roopasumanth is offline Offline
Newbie Poster

external sorting in java

  #1  
Jul 18th, 2005
hi i want to do a program for mway search( external sorting),displaying each step of sort in java, can any one of you please help me, i am a starter in java.

thanks in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: external sorting in java

  #2  
Jul 19th, 2005
Hi everyone,

I don't really understand your question. Maybe you can try and explain a little more in detail

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote  
Join Date: Jul 2005
Posts: 3
Reputation: roopasumanth is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
roopasumanth roopasumanth is offline Offline
Newbie Poster

Re: external sorting in java

  #3  
Jul 20th, 2005
the given data will bestored in a .dat file and the o/p should contain following things:

X is also accepted from console
Given 7 15 8 14 3 1 19 11 13 6 10 12 2 5 4 16 17 18 9 on tape 1 and assuming that only X=4 items can fit in RAM at a time. The sort may be performed as follows:
T1: {7 15 8 14 3 1 19 11 13 6 10 12 2 5 4 16 17 18 9}
T2:
T3: {7 8 14 15} {6 10 12 13} {9 17 18} T3, T4 after 1st pass. T1 is
T4: {1 3 11 19} {2 4 5 16} rewound for re-use.


After 2-way merge of the sorted groups from T3, T4 into T1 and T2
T1: {1 3 7 8 11 14 15 19} {9 17 18}
T2: {2 4 5 6 10 12 13 16}

T3, T4 are rewound for re-use. 2-Way merge of T1, T2 into T3 and T4
T3: {1 2 3 5 6 7 8 9 10 11 12 13 14 15 16 19}
T4: {9 17 18}

The last step is the 2-Way merge of T3, T4 into T1
T1: {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19}
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 9:33 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC