- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 Python学习
优点:简单、易学、免费、开源、高层语言、可移植性、解释性、面向对象、可扩展、丰富的库、规范的代码。缺点:运行速度慢。国内市场较小。构架选择太多。...
2020-01-02 11:02:32
64
原创 插入排序
void insertSort(vector<int>s){for(int i=1;i<s.size();i++){if(s[i]<s[i-1]){int t=s[i];int j;for(j=i-1;s[j]>s[i];j--){s[j+1]=s[j];}s[j+1]=t;}}} 空间复杂度:O(1)时间复杂度...
2018-11-10 21:20:59
92
原创 简单选择排序
void selectSort(vector<int> S){int min;for(int i=0;i<S.size()-1;i++){min=i;for(int j=i+1;j<S.size();j++){if(S[j]<S[min]){min=j;}}if(min!=i){swap(S[i],S[min]);}}...
2018-11-03 10:52:14
124
原创 冒泡排序
第一种:交换排序void bubbleSort(vector<int>s){ for(int i=0;i<s.size()-1;i++){for(int j=i+1;j<s.size();j++){if(s[i]>s[j]){swap(s[i],s[j]);}}}}第二种:冒泡排序void bubbleSort(vector<in...
2018-10-20 19:53:06
155
转载 JDK在Linux下的配置
1,到 Sun 的官网下载选择 accept license ,然后选择适合自己JDK,学电脑,我这里下载的是jdk-8u60-linux-i586.tar.gz2,解压文件,修改文件名创建文件夹:$ sudo mkdir /usr/lib/jvm进入到下载的文件当前目录解压文件到指定目录:$ sudo tar zxvf jdk-7u21-linux-i586.tar.gz -
2016-07-02 11:37:04
214
原创 sky_Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may a
2016-05-22 22:11:41
161
原创 sky_Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.总结:递归得
2016-05-22 21:17:25
221
原创 sky_Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling you
2016-05-22 01:00:53
595
原创 sky_Intersection of Two Arrays
Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be unique.The
2016-05-21 00:50:03
197
原创 sky_add_digits
很粗暴的解决方式,虽然题目中提到不要用循环,而且要求算法为 O(1),看别人写的代码,觉得很神奇#include using namespace std;class Solution {public: int addDigits(int num) { int sum=0; while(num>0) {
2016-05-17 00:09:13
213
ResNet残差网络
2019-01-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人