Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
programming assignment
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="imhotep" data-source="post: 24061831" data-attributes="member: 562115"><p>Explain the linear search and the binary search in terms of the big O notation. There should be plenty of resources on the net.</p><p>a linear search (assuming a sorted list) is parsing through the list to locate the number you seek - say for a list of n numbers, the worst case is n iterations, and so we can say for the linear search is O<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" /></p><p>For a binary search, you start off from the middle element and depending on what we look for is less or greater than this mid element we search through the lower or upper segments using the same technique. This approach takes log<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" /> iterations and thus has O(log<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt="(n)" title="Thumbs down (n)" loading="lazy" data-shortname="(n)" />)</p></blockquote><p></p>
[QUOTE="imhotep, post: 24061831, member: 562115"] Explain the linear search and the binary search in terms of the big O notation. There should be plenty of resources on the net. a linear search (assuming a sorted list) is parsing through the list to locate the number you seek - say for a list of n numbers, the worst case is n iterations, and so we can say for the linear search is O(n) For a binary search, you start off from the middle element and depending on what we look for is less or greater than this mid element we search through the lower or upper segments using the same technique. This approach takes log(n) iterations and thus has O(log(n)) [/QUOTE]
Insert quotes…
Verification
Hath warak paha keeyada? (hatha wadikireema paha)
Post reply
Top
Bottom