@@ -0,0 +1,1475 @@
+//  Copyright 2016 The Sawdust Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A//%0A%0Apackage array;%0A%0A/**%0A * %3Cpre%3E%0A * given an inorder array.%0A * find the number to match%0A *     array%5Bi%5D %3C= it %3C= array%5Bj%5D%0A *     i %3C  its index%0A *     j %3E its index%0A * Require runtime Big o(n), space Big O(1).%0A * Assume there exists always at least one pivotal number.%0A * ========================================================%0A *                                update maxByfar%0A *   ------------maxByfar------------------------------%0A *%0A *                             continue%0A *    ---candidate--------------------------------------%0A *                    invalid%0A *   %5Barray%5D%0A */%0Apublic class FindPivotalNumber %7B%0A    public static int pivotalOf(int%5B%5D arr) %7B%0A        int maxByfar = arr%5B0%5D;%0A        boolean stillValid = true;%0A        int candidate = arr%5B0%5D;%0A        for (int i = 1; i %3C arr.length; i++) %7B%0A%0A        %7D%0A        // TODO: 8/6/16%0A        return 0;%0A    %7D%0A%7D%0A

Find Pivotal number in an inorder array