Questions tagged [bisection]

Anything related to a class of algorithms where the result is found by searching either the upper or the lower half of a sorted set of items and repeating this procedure recursively. Commonly used to refer to the bisection method (to find a root of an equation) or to the bisection search algorithm (to search a sorted list for a matching element).

Anything related to a class of algorithms where the result is found by searching either the upper or the lower half of a sorted set of items and repeating this procedure recursively, narrowing the search at each step.

Two common examples of bisection algorithms are:

233 questions
-2
votes
1 answer

My Bisection method in c++

I'm study Computer science in 4 degree and i'm trouble with bisection method implementation in c++. The error is about the code run one time and end, i tried some changes but any good result :( If you can help me, please do it. I saw some…
Gui
  • 1
-2
votes
2 answers

Having trouble understanding bisection searching and recursion

Here's the problem I'm trying to wrap my head around: We can use the idea of bisection search to determine if a character is in a string, so long as the string is sorted in alphabetical order. First, test the middle character of a string against…
-2
votes
2 answers

Median sort a list in unordered fashion

What's the best way of sorting a python list in an unordered fashion according to the median of value positions in the list? Suppose: a = [1, 3 ,6, 7, 10, 12, 17] I'm looking for this: a = [1, 17, 7, 3, 12, 6, 10] Meaning, the list now looks like…
Yasin
  • 499
  • 8
  • 21
-3
votes
1 answer

Problem with Bisection method on Visual Basic

Here is my code for a bisection method. If I input 4 and 5 the program loops infinitely. There is a problem with it running. Sub TheBisectionMethod1() Dim a, b As Double 'Taking two variables, A and B Console.Write(vbLf & "Input A:…
loco3424
  • 25
  • 1
  • 6
-3
votes
1 answer

How is the logic reasoning done in these three codes?

def findRoot1(x, power, epsilon): low = 0 high = x ans = (high+low)/2.0 while abs(ans**power - x) > epsilon: if ans**power < x: low = ans else: high = ans ans = (high+low)/2.0 …
Eliza
  • 101
  • 1
  • 1
  • 7
-5
votes
1 answer

Syntax Error using CoreMath "public double..."

This is the error that I receive: Multiple markers at this line - Syntax error on token "double", { expected - Syntax error, insert "interface Identifier" to complete InterfaceHeader - Syntax error on token "double", @…
Jammer
  • 1
  • 1
-5
votes
2 answers

write code to find square-root using bisection method in c++?

Bisection is as far as i know narrowing your search and reach the specific value in interval. please give me a sample of that how to make a generic code to find square-root. the way i think is taking three variables low, mid, high. high = userinput,…
Jhon Smith
  • 21
  • 1
  • 2
-6
votes
1 answer

Bisection Method - C#

I have a function called Bisection method that Accepts 4 parameters , delegate of a function , start and end of interval and user guess of the solution. Here is the function: public static double Bisection_method (MyFun fun , double start ,…
Ahmad Adel
  • 47
  • 10
1 2 3
15
16