View Poll Results: Is the algorithm something new and good??
- Voters
- 6. You may not vote on this poll
Results 1 to 15 of 15
8Likes Thread: A new search algorithm by me....is it good????
- 11-22-2011, 06:19 PM #1
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
A new search algorithm by me....is it good????
here is d doc to my ALGO plzz check and tell me weder it is effecient or not ;-)... d article is still incomplete... i m working on it nd even d prog has a bit bug in it... ill fix it vry soon.... i jst wanted to get d ALGO chkd by sm experts out here :-) https://docs.google.com/document/d/1.../edit?hl=en_US
- 11-22-2011, 07:10 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: A new search algorithm by me....is it good????
I'm sorry for saying so, but it is crap; every comparison takes one step so in total your algorithm takes O(n) steps to complete; your conclusion is wrong, otherwise it would be better to divide a list with n elements in n parts and, according to your reasoning, the searching would take O(1) steps.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-22-2011, 07:19 PM #3
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
but is it not better den linear search??
- 11-22-2011, 07:20 PM #4
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
thnx for correcting me :-).... cn u do d proper analysis of d code for me??? plzzz? :-)
- 11-22-2011, 09:17 PM #5
Re: A new search algorithm by me....is it good????
I wouldn't expect anything earth-shaking from somebody too lazy to spell words in full. Recommended reading
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 11-22-2011, 09:43 PM #6
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: A new search algorithm by me....is it good????
No. it s nt btr thn a lnr srch
- 11-23-2011, 08:44 AM #7
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
Can any one provide proper reasons?? why the algorithm is not better than linear search??
- 11-23-2011, 09:09 AM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: A new search algorithm by me....is it good????
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-23-2011, 09:23 AM #9
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
but the number of iterations taken by linear search is more than that of mine....
- 11-23-2011, 09:41 AM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: A new search algorithm by me....is it good????
No it isn't; you are counting four search operations as one; that is incorrect. My counter example again: if a sequence contains n elements, break it up in n parts; each part takes O(1) search operations, so dividing by n yields a better search algorithm (not!)
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-23-2011, 02:58 PM #11
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
Can multi threading help in this case ???? like if i use dat den all the comparisons would be done at the same time ryt??please pardon me if my judgments are wrong.I am no expert yet but have a lot of interest and passion for coding.Its not even been a year since when i have learned java.... SO please do not get bugged if i ask or say something unrealistic ;-)
- 11-23-2011, 07:11 PM #12
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
bdw sir can u giv me a situation where linear search would perform better than this???
- 11-23-2011, 09:41 PM #13
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Re: A new search algorithm by me....is it good????
As Jos said, it's still O(n), say the element to be searched for is at arr.length/4, you will have to do n comparisons. All this does is make 4 comparisons at each step.
If this really yielded better results, why stop at divisions of 4? Why not 8, 16, 32, etc.?
- 11-24-2011, 06:50 AM #14
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
if i use thread over here wouldn't all 4 comparison be done at the same step???and would doing that help?? :-)
- 11-24-2011, 06:53 AM #15
Member
- Join Date
- Nov 2011
- Posts
- 23
- Rep Power
- 0
Re: A new search algorithm by me....is it good????
and the division sunde887 u spoke of is absolutely correct i thought of it but that can be applicable when the number list is huge.... but don you think by this code the probability of searching an element increases??? just the probability not speed!!!! :-)
Similar Threads
-
Good beginner book for Algorithm
By gozuhair in forum New To JavaReplies: 2Last Post: 08-21-2011, 02:52 PM -
Any advice - java search algorithms which accept multiple search parameters
By Alfster in forum New To JavaReplies: 4Last Post: 03-24-2011, 11:50 PM -
build search tree on minimax algorithm...
By me26 in forum Java GamingReplies: 2Last Post: 06-29-2010, 08:24 AM -
Hello Good Morning, Good afternoon, and Good Evening
By MrFreeweed in forum IntroductionsReplies: 3Last Post: 12-11-2009, 03:32 PM -
Finding a connection between cities using least-cost search algorithm
By Java Tip in forum java.langReplies: 0Last Post: 04-12-2008, 08:38 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks