View previous topic :: View next topic
|
Author |
Message |
learnmf
Active User
Joined: 14 Mar 2005 Posts: 123
|
|
|
|
Hi friends,
What happens if we use a unsorted table in a search all.
Thanks |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
No compile/runtime error.
But you may get unexpected/incorrect result. |
|
Back to top |
|
|
learnmf
Active User
Joined: 14 Mar 2005 Posts: 123
|
|
|
|
Hi priya
I get confused.What is the exact result. |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
As Search all perform binary search...so when it will search for a certain key value it will try to divide total number of record into 2 part and at that time when record that need to be searched, even if it is present it might can give record not found.It 's a lucj if u get the record, and luck is not supported in S/W field.
eg say
the list is
4, 6,2,8,1,9,5
and you want to search 1, then as total lenght is 7 hence it will try to get the mid key value, if the mid key value is greter than the key need to be searched then left portion should contain the record, as it is mandatory for SEARCH ALL that to be sorted. Now in this case mid record key is 8 then it will start calculation only with
4, 6, 2, 8.
Now in this case it will get try to search 1 in that and it won't get but it is present in parent record list.I think now you get the problem. |
|
Back to top |
|
|
learnmf
Active User
Joined: 14 Mar 2005 Posts: 123
|
|
|
|
Hi kanak
Thanks .Now i ve the clear idea.
thanks |
|
Back to top |
|
|
|