| Author |
help with code
|
Emaney Sidd
Greenhorn
Joined: Mar 11, 2006
Posts: 2
|
|
Can any one please help me finish the following code, filling in the blanks PLZ this is very urgent, ......soon as possible priavte void NSort(int first, int last, int increment) { for (int i = _ ; i <= _ ; _ ) { int temp = contents[ _ ]; int j; for (j= _ ; _ ; _ ) { contents[ _ ] = contents[ _ ]; } contents[ _ ] = temp; } } [ EJFH: Remove request to take this offline. ] [ March 11, 2006: Message edited by: Ernest Friedman-Hill ]
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24081
|
|
Hi, Welcome to JavaRanch! We'll be glad to help. Show us what you've done so far, and we can tell you if it's right or not, and suggest where to go next.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Emaney Sidd
Greenhorn
Joined: Mar 11, 2006
Posts: 2
|
|
private void NSort(int first, int last, int increment) { for (int i = 0 ; i <=currSize ; ++i) { int temp = contents[ currSize]; int j; for (j= 0 ; j<contents[currSize] ; ++j ) { contents[ currSize] = contents[ temp]; } contents[ i ] = temp; } }
|
 |
Garrett Rowe
Ranch Hand
Joined: Jan 17, 2006
Posts: 1295
|
|
|
Well, the first thing I can see is that there is no variable in this method called "currSize". Is currSize a class scoped variable?
|
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
|
 |
Mark Van Tuyl
Ranch Hand
Joined: Mar 22, 2002
Posts: 60
|
|
|
I've formatted your code and added some comments. Hope it helps
|
<a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank" rel="nofollow">How To Ask Smart Questions</a>
|
 |
 |
|
|
subject: help with code
|
|
|