• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding the closet element to Zero in a Array  RSS feed

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am having an Array in which i need to find out , what is the closet element to Zero in that Array .
Assume that i am having an array of this type



Please let me know as how to achive this .
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried? We are NotACodeMill.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried? We are NotACodeMill.


Ok ,

I tried this way




But i dont want to use inbuilt Mechanism like Arrays.sort , i want to do it programatically .
Any help i can get from you .
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If someone gave you a list of number, and you couldn't sort them, how would you do it using nothing but your brain, pencil, and paper?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:If someone gave you a list of number, and you couldn't sort them, how would you do it using nothing but your brain, pencil, and paper?


This should always be the first thought in approaching any problem ... after all, how can you teach the computer to do something, when you don't even know how to do it yourself?

Henry
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!