RSS
DaniWeb Home
>
Forums
>
Software Development
>
Java
>
to secomd smallest...
Re: to secomd smallest number in array
Please support our
Java
advertiser:
Lunarpages Java Web Hosting
to secomd smallest number in array
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,651
Reputation:
Rep Power:
12
Solved Threads: 311
peter_budo
Online
Code tags enforcer
Re: to secomd smallest number in array
#
6
Apr 8th, 2007
Already I can see problem here, in both cases if/else statement will be useless if first two numbers will be some of largest. You are expecting smallest number to be on one of first two positions in array.
Consider following array and think about it again
arr = {4, 5, 1, 3, 2}
Last edited by peter_budo : Apr 8th, 2007 at
5:36 am
.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community
,
JAVAWUG (Java Web User Group)
,
Coding the Architecture
peter_budo
View Public Profile
Send a private message to peter_budo
Find all posts by peter_budo
Java Forum Highlights
Today's Posts
Java
Software Development
All Forums
Unanswered Threads
Java
Software Development
All Forums
Java Related Features
Java Forum
Solved Java Threads
Software Development Blog
Java Tutorials
java Code Snippets
Java Directory Links
Software Development Directory Links
Advertising Opportunities on DaniWeb
Contact Us
-
Newsletter Archive
-
Sitemap
-
Privacy Statement
All times are GMT -4. The time now is
7:24 am
.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC