File:Binary Search Depiction.svg
Tools
Actions
General
Print/export
In other projects
Appearance
From Wikimedia Commons, the free media repository
Size of the above preview of this SVG file: 500 × 213 pixels. Other resolutions: 330 × 140 pixels | 960 × 409 pixels | 1,280 × 545 pixels | 3,840 × 1,634 pixels.
Original file (SVG file, nominally 470 × 200 pixels, file size: 6 KB)
File information
Structured data
Captions
Captions
Representation of the process of binary search to find the position of an element in a sorted list.
Summary
[edit]| DescriptionBinary Search Depiction.svg |
English: This is an example of a binary search steps through time. Source code and output:
int[] numbersArray = {1,3,4,6,7,8,10,13,14,18,19,21,24,37,40,45,71};
public boolean binarySearchAlgorithm(int targetNumber, int[] numbers)
{
int lowerLimit = 0;
int upperLimit = numbers.length - 1;
while (upperLimit >= lowerLimit)
{
int middleNumber = (lowerLimit + upperLimit)/2;
if (numbers[middleNumber] == targetNumber)
{
return true;
}
if (numbers[middleNumber] < targetNumber)
{
lowerLimit = middleNumber + 1;
}
if (numbers[middleNumber] > targetNumber)
{
upperLimit = middleNumber - 1;
}
}
return false;
}
System.out.println(binarySearchAlgorithm(7, numbersArray)); //prints "true"
iteration 1
iteration 2
iteration 3
iteration 4
|
| Date | |
| Source | Own work |
| Author | AlwaysAngry |
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 15:33, 1 December 2016 | 470 × 200 (6 KB) | AlwaysAngry (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
File usage on other wikis
The following other wikis use this file:
- Usage on ar.wikipedia.org
- Usage on ary.wikipedia.org
- Usage on bn.wikipedia.org
- Usage on en.wikipedia.org
- Usage on en.wiktionary.org
- Usage on fa.wikipedia.org
- Usage on fr.wikipedia.org
- Usage on he.wikipedia.org
- Usage on hu.wikipedia.org
- Usage on incubator.wikimedia.org
- Usage on ja.wikipedia.org
- Usage on kn.wikipedia.org
- Usage on ko.wikipedia.org
- Usage on mk.wikipedia.org
- Usage on pl.wikipedia.org
- Usage on ru.wikipedia.org
- Usage on sr.wikipedia.org
- Usage on sv.wikipedia.org
- Usage on th.wikipedia.org
- Usage on tr.wikipedia.org
- Usage on uk.wikipedia.org
- Usage on vi.wikipedia.org
- Usage on www.wikidata.org
- Usage on zh-yue.wikipedia.org
- Usage on zh.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
| Width | 470px |
|---|---|
| Height | 200px |
Structured data
Items portrayed in this file
depicts
some value
30 November 2016
image/svg+xml
b8165b6ea1ea892f92e32bae011e05e71bc5fcd2
5,806 byte
200 pixel
470 pixel
Hidden categories: