<commit_before>//
//  ViewController.swift
//  6-Sort
//
//  Created by keso on 2016/11/27.
//  Copyright © 2016年 FlyElephant. All rights reserved.
//

import UIKit


class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        bubbleSort()
        selectSort()
        insertSort()
        shellSort()
        mergeSort()
        qucikSort()
        
        //var heapData:[Int] = [1, 3, 4, 5, 2, 6, 9, 7, 8, 0]
        var minHeapData:[Int] = [16,7,3,20,17,8]
        let heapSort:HeapSort = HeapSort()
        
        heapSort.heapSort(arr: &minHeapData)
        
        print("FlyElephant--小根堆结果---\(minHeapData)")
        
        var maxHeapData:[Int] = [16,7,3,20,17,8]
        heapSort.heapMaxSort(arr: &maxHeapData)
        print("FlyElephant--大根堆结果---\(maxHeapData)")
        
        let data:[Int] = [1,2,3,2,4,8,9,10,19,0]
        let result = quickSort(data: data)
        print("方案1:-\(result)")
        
        var arr:[Int] = [10,3,17,8,5,2,1,9,5,4]
        quickSort(data: &arr, low: 0, high: arr.count-1)
        print("方案2:-\(arr)")
        
        let roateArr:[Int] = [3,4,5,1,2]
        let roateResult:Int? = self.minOfRoateArr(arr: roateArr)
        if let minResult = roateResult {
            print("旋转数组中的最小值:\(minResult)")
        }
        
        let roateArr1:[Int] = [1,1,1,0,1]
        let roateResult1:Int? = self.minOfRoateArr(arr: roateArr1)
        if let minResult = roateResult1 {
            print("旋转数组中的最小值:\(minResult)")
        }
        
     
        if self.judgeNumber(number: 8) {
             print("8是2的整数次幂")
        }
        
        if self.judgeNumber(number: 10) {
            print("10是2的整数次幂")
        } else {
            print("10不是2的整数次幂")
        }
        
        let fibResult:Int = self.fibonacci(n: 12)<commit_msg>update~<commit_after>//
//  ViewController.swift
//  6-Sort
//
//  Created by keso on 2016/11/27.
//  Copyright © 2016年 FlyElephant. All rights reserved.
//

import UIKit


class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        bubbleSort()
        selectSort()
        insertSort()
        shellSort()
        mergeSort()
        qucikSort()
        
        //var heapData:[Int] = [1, 3, 4, 5, 2, 6, 9, 7, 8, 0]
        var minHeapData:[Int] = [16,7,3,20,17,8]
        let heapSort:HeapSort = HeapSort()
        
        heapSort.heapSort(arr: &minHeapData)
        
        print("FlyElephant--小根堆结果---\(minHeapData)")
        
        var maxHeapData:[Int] = [16,7,3,20,17,8]
        heapSort.heapMaxSort(arr: &maxHeapData)
        print("FlyElephant--大根堆结果---\(maxHeapData)")
        
        let data:[Int] = [1,2,3,2,4,8,9,10,19,0]
        let result = quickSort(data: data)
        print("方案1:-\(result)")
        
        let roateArr:[Int] = [3,4,5,1,2]
        let roateResult:Int? = self.minOfRoateArr(arr: roateArr)
        if let minResult = roateResult {
            print("旋转数组中的最小值:\(minResult)")
        }
        
        let roateArr1:[Int] = [1,1,1,0,1]
        let roateResult1:Int? = self.minOfRoateArr(arr: roateArr1)
        if let minResult = roateResult1 {
            print("旋转数组中的最小值:\(minResult)")
        }
        
     
        if self.judgeNumber(number: 8) {
             print("8是2的整数次幂")
        }
        
        if self.judgeNumber(number: 10) {
            print("10是2的整数次幂")
        } else {
            print("10不是2的整数次幂")
        }
        
        let fibResult:Int = self.fibonacci(n: 12)
{'fraction_non_alphanumeric': 0.13985448666127728, 'fraction_numerical': 0.047696038803556995, 'mean_word_length': 1.8015094339622642, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1191529', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1371, 'n_words': 239}