- 博客(7)
- 收藏
- 关注
原创 数据结构与算法 -day04(queue stack算法 )
猫狗队列 【题目】 宠物、狗和猫的类如下: public class Pet { private String type; public Pet(String type) { this.type = type; } public String getPetType() { return this.type; }} public class Dog extends Pet { public Dog() { super(“dog”); } } public class Cat extends Pet { pub
2020-10-15 14:23:59
198
原创 数据结构与算法 -day03(queue stack算法 )
工程中的综合排序算法 样本量小的情况下 考虑常数项 考虑排序算法的稳定性 有关排序问题的补充: 1,归并排序的额外空间复杂度可以变成O(1),但是非常难,不 需要掌握,可以搜“归并排序 内部缓存法” 2,快速排序可以做到稳定性问题,但是非常难,不需要掌握, 可以搜“01 stable sort” 3,有一道题目,是奇数放在数组左边,偶数放在数组右边,还 要求原始的相对次序不变,碰到这个问题,可以怼面试官。面试 官非良人。 认识比较器的使用 import java.util.Arrays; import ja
2020-10-14 20:29:40
252
原创 数据结构与算法 -day02(排序算法 )
day02 1 题目 给定一个数组arr,和一个数num,请把小于等于num的数放在数组的左边,大于num的数放在数组的右边。 要求额外空间复杂度O(1),时间复杂度O(N) 定义位置index,交换时index前移 public static void patition(int[] arr, int num) { if (arr == null || arr.length < 2) { return; } int index =
2020-10-13 21:28:51
250
原创 数据结构与算法 -day01(排序算法 小和问题 复杂度)
day01 1.认识时间复杂度 常数操作 时间复杂度为O(f(N)) 评价一个算法流程的好坏,先看时间复杂度的指标,然后再分析不同数据样本下的实际运行时间,也就是常数项时间。 冒泡法排序: public static void bubbleSort(int[] arr) { if (arr == null || arr.length < 2) { return; } for (int e = arr.length - 1;
2020-10-13 10:23:12
248
转载 (转载)ubuntu 18.04 安装pytorch
第一步:安装pip3 sudo apt-get install python3-pip 顺便安装numpy pip3 install numpy 然后会提示你更新pip的版本,于是我就选择更新了 pip3 install --upgrade pip 第二步:配置pip使用的镜像源 附: 国内镜像源列表 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 ...
2020-04-21 22:47:31
1036
原创 机械师F-117 Ubuntu 安装显卡驱动以及CUDA
1.进入 Ubuntu 高级 2.改变源 3.终端 sudo apt-get update #for case1: original driver installed by apt-get: sudo apt-get remove --purge nvidia* #for case2: original driver installed by runfile: sudo update-initra...
2020-04-20 21:29:59
695
转载 c++中遍历容器
(自用)转载自:https://www.cnblogs.com/jiayayao/p/6138974.html C++使用如下方法遍历一个容器: #include “stdafx.h” #include #include int main() { std::vector arr; arr.push_back(1); arr.push_back(2); for (auto it = arr.begi...
2019-05-08 18:25:27
1058
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅