You are not logged in. Please login at www.codechef.com to post your questions!

×

binary_search C++-STL

I want to find whether a given element is present in a array or not using the function binary_search(). But before passing the array as argument, do I need to sort it or will sorting automatically done by the function?

asked 28 Mar '15, 21:46

anupam_datta's gravatar image

4★anupam_datta
469529
accept rate: 7%


link

answered 28 Mar '15, 21:56

rishu97kr's gravatar image

2★rishu97kr
2528
accept rate: 0%

edited 28 Mar '15, 21:57

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,911
×1,038

question asked: 28 Mar '15, 21:46

question was seen: 963 times

last updated: 28 Mar '15, 21:57