分治——sqtx

题目描述

Given a string s, partition s such that every substring of the partition is a palindrome.

Return all possible palindrome partitioning of s.

For example, given s ="aab",
Return

  [
    ["aa","b"],
    ["a","a","b"]
  ]


public class Solution {  
    public int sqrt(int x) {  
        // Start typing your Java solution below  
        // DO NOT write main() function  
        double error = 0.0000001f;  
        double high = x;  
        double low = 0;  
        while(high-low> error){  
            double mid = (high+low)/2;  
            if(mid*mid>x){  
                high = mid;  
            }else {  
                low = mid;  
            }  
        }  
        return (int)Math.floor(high);  
    }  
}  
原文地址:https://www.cnblogs.com/zxqstrong/p/5333696.html