{"action":"opened","issue":{"url":"https://api.github.com/repos/mishe/blog/issues/17","labels_url":"https://api.github.com/repos/mishe/blog/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/mishe/blog/issues/17/comments","events_url":"https://api.github.com/repos/mishe/blog/issues/17/events","html_url":"https://github.com/mishe/blog/issues/17","id":119898519,"number":17,"title":"快速排序在JS下的实现 (转自个人百度空间)","user":{"login":"mishe","id":1996187,"avatar_url":"https://avatars.githubusercontent.com/u/1996187?v=3","gravatar_id":"","url":"https://api.github.com/users/mishe","html_url":"https://github.com/mishe","followers_url":"https://api.github.com/users/mishe/followers","following_url":"https://api.github.com/users/mishe/following{/other_user}","gists_url":"https://api.github.com/users/mishe/gists{/gist_id}","starred_url":"https://api.github.com/users/mishe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishe/subscriptions","organizations_url":"https://api.github.com/users/mishe/orgs","repos_url":"https://api.github.com/users/mishe/repos","events_url":"https://api.github.com/users/mishe/events{/privacy}","received_events_url":"https://api.github.com/users/mishe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-02T09:15:30Z","updated_at":"2015-12-02T09:15:30Z","closed_at":null,"body":"function ksort(arr){\r\n\r\n        var a=arr.slice(),len=a.length,start=0,end=len-1;\r\n\r\n        function sort(start,end){\r\n\r\n            if(start>end)\r\n                return;\r\n            var tmp=a[start],i=start,j=end,t;\r\n            while(i!=j){\r\n                while(a[j]>=tmp && i<j){\r\n                    j--\r\n                }\r\n                while(a[i]<=tmp && i<j){\r\n                    i++\r\n                }\r\n                if(i<j){\r\n                    t=a[i];\r\n                    a[i]=a[j];\r\n                    a[j]=t;\r\n                }\r\n\r\n            }\r\n\r\n            a[start]=a[i];\r\n            a[i]=tmp;\r\n            sort(start,i-1)\r\n            sort(i+1,end)\r\n        }\r\n        sort(start,end)\r\n        return a;\r\n    }\r\n\r\nd=[1,4,3,9,0,2,5,7,8,21,44,43];\r\n\r\n    ksort(d)"}}