最近在温习C语言,看的书是<C primer Plus>,忽然想起来以前在参加数学建模的时候,用过的一些智能算法,比如遗传算法.粒子群算法.蚁群算法等等.当时是使用MATLAB来实现的,而且有些MATLAB自带了工具箱,当时有些只是利用工具箱求最优解问题,没有自己动手亲自去实现一遍,现在都忘的差不多了.我觉得那样层次实在是很浅,没有真正理解算法的核心思想.本着"纸上得来终觉浅,绝知此事要躬行"的态度,我决定现在重新复习一遍算法,然后手工用C语言重新实现一遍.说做就做,我第一
Almost equilateral triangles It is easily proved that no equilateral triangle exists with integral length sides and integral area. However, the almost equilateral triangle 5-5-6 has an area of 12 square units. We shall define an almost equilateral tr
一天一道LeetCode 本系列文章已全部上传至我的github,地址: https://github.com/Zeecoders/LeetCode 欢迎转载,转载请注明出处 (一)题目 Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to
算法(Algorithm):一个计算过程,解决问题的方法时间复杂度:用来评估算法运行效率的一个东西ps:在日常使用中,请使用sort(),because no zuo no die! 1.冒泡排序:指针如同气泡一样一个个由下向上浮,每次上浮如果上面的数比自己小则交换位置,这样就保证每次可以使最大的数字排列在最上面,重复此过程直到所有数有序:时间复杂度为O(n2),wtf,平方怎么打,就酱吧. def bubble_sort_x(data): for i in range(len(data)-1)