自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(65)
  • 资源 (2)
  • 收藏
  • 关注

原创 ImprotError: cannot import 'imread' Object arrays cannot be loaded when allow_pickle=False

问题:解决办法:可以在anaconda 环境下,输下面命令问题:解决办法:numpy的np.load()参数allow_pickle默认为False, 因此需要自己注明 为 True,...

2020-04-21 19:39:55 205

原创 安装Tensorflow-Gpu Keras-GPU NVIDIA 驱动

我用的版本配置:Tensorflow-GPU==1.15.0+db2 Keras-GPU==2.2.4通过一下命令查询 可以安装的tensorflow-gpu 的版本及资源路径使用conda 查询可安装包按照路径进行安装对应的安装包,这样比不写路径装速度更快,并且可以查到。详细查询进行安装conda install --channel https:...

2019-12-05 10:28:52 660 1

原创 修改了Ubuntu下的/usr目录权限,导致不能使用sudo命令的修复

由此在ubuntu下,因为某种原因,手动给usr文件夹改了权限,之后我自己这个账户(非root)就不能运行sudo命令,提示“sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner”的错误遇到这个问题说明当前用户没有sudo执行权限。赋予sudo执行权限需要在root的模式下执行,系统默认禁用root账号,如果你的系...

2019-12-02 13:52:18 2480 2

原创 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome.Example 1:Input: 1->2Output: falseExample 2:Input: 1->2->2->1Output: trueFollow up:Could you do it in O(n) time a...

2018-09-23 10:29:24 141

原创 LeetCode 225. Implement Stack using Queues && 232. Implement Queue using Stacks

LeetCode 225. Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top()...

2018-09-19 18:10:01 161

原创 LeetCode 206. Reverse Linked List

Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or recursi...

2018-09-16 10:46:23 136

原创 LeetCode 205. Isomorphic Strings

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with another ...

2018-09-16 10:17:09 131

原创 数组与字符串--- 整数/字符串之间的转换

sscanf函数:    sscanf函数原型为int sscanf(const char *str, const char *format, ...)。将参数str的字符串根据参数format字符串来转换并格式化数据,转换后的结果存于对应的参数内。具体功能如下:(1)根据格式从字符串中提取数据。如从字符串中取出整数、浮点数和字符串等。(2)取指定长度的字符串...

2018-09-10 12:11:08 1057

原创 数组与字符串 -- 颠倒单词的出现顺序

  

2018-09-10 10:57:17 442

转载 LeetCode ---204. Count Primes

Count the number of prime numbers less than a non-negative number, n.Example:Input: 10Output: 4Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.思路:利用厄拉多塞筛法。具体操作:先将 ...

2018-09-09 22:22:09 130

原创 LeetCode ---202. Happy Number

Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares o...

2018-09-09 21:14:06 144

原创 LeetCode 198. House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...

2018-09-08 20:47:40 148

原创 LeetCode.Bash 相关题

193. Valid Phone NumbersGiven a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers.You may assume that a valid ph...

2018-09-08 17:11:46 200

原创 数组与字符串--删除特定字符

   

2018-09-08 16:20:29 1510

原创 数组与字符串--寻找第一个无重复字符

 

2018-09-08 15:51:04 204

原创 235. Lowest Common Ancestor of a Binary Search Tree 树 面试试题---最低公共祖先

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw...

2018-09-08 14:44:49 169

原创 LeetCode.189 Rotate Array

Given an array, rotate the array to the right by k steps, where k is non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1...

2018-09-05 09:29:53 149

原创 LeetCode . MySql 相关题

175. Combine Two TablesTable: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+--...

2018-09-02 19:36:59 143

原创 136. Single Number

Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without us...

2018-08-25 16:31:01 95

原创 125 Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty string as valid palindrome.Examp...

2018-08-25 15:45:01 125

原创 121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...

2018-08-25 10:06:02 101

原创 LeetCode 112. Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf is a node with no children.Example:...

2018-08-13 17:05:08 109

原创 LeetCode 111. Minimum Depth of Binary

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is a node with no childre...

2018-08-13 16:39:09 117

原创 LeetCode 110 Balanced Binary Tree

Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of every node never diff...

2018-08-13 11:38:46 116

原创 LeetCode 101. Symmetric Tree (对称二叉树) 108. Convert Sorted Array To BST(二叉搜索树)

101. Symmetric Tree (对称二叉树)Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \...

2018-08-13 11:15:37 97

原创 LeetCode 107.Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15,7...

2018-08-12 18:08:29 120

原创 LeetCode - Same Tree 100

Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Example ...

2018-08-12 12:01:55 168

原创 LeetCode 88 Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively. You may assume tha...

2018-08-11 21:44:06 78

原创 LeetCode - 70 Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive...

2018-08-11 17:24:38 104

原创 LeetCode-69 Sqrt(x)

Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are truncated and only...

2018-08-11 11:31:51 147

转载 LeetCode 67 - Add Binary

Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = "11", b = "1"Output: "100"Exam...

2018-08-11 10:36:41 135

原创 LeetCode 58 Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defin...

2018-08-10 21:23:03 94

原创 LeetCode 53 Maximum Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Explanati...

2018-08-10 21:14:46 99

原创 Leetcode - Merge Two Sorted List

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Output: 1-...

2018-08-06 21:20:17 137

原创 LeetCode - Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dea...

2018-08-06 15:16:58 85

原创 C++与STL入门

今天学的一点C++知识1.c++版本框架:c++头文件:stdio.h ->  cstdio   string ->  cstring   math.h -> cmath  ctype.h  -> cctypec++ 程序 加  using namespace std;  这句话这个是什么意思呢? C++中有一个“名称空间”(namespace)的概念,...

2018-07-27 14:53:16 992

原创 java学习随笔

eclipse 的一些快捷键:ctrl+1 快捷修复ctrl+d 快捷删除行shift+enter 换行ctrl+f11 快速运行项目alt+↑/↓ 快速移动行ctrl+m 放大工作区ctrl+shift+r:打开资源ctrl+o:快速outline 查看类ctrl+e:快速转换编辑器alt+shift+r:重命名shift+enteralt+c...

2018-07-25 15:58:03 287

原创 函数与递归-信息解码问题

问题描述:考虑下面的01串序列:0,00,01,10,000,001,010,011,100,101,110,0000,0001,....,1101,1110,00000....首先是长度为1的 串,然后是长度为2的串,以此类推。如果看成二进制,相同长度的后一个串等于前一个串加1.上述序列不存在全为1的串。我们的任务是编写一个解码程序。首先输入一个编码头AB#TAN则根...

2018-07-25 13:04:15 332

原创 数组-猜数字游戏的提示

猜数字游戏的提示: 实现一个经典“猜数字”游戏。给定答案序列和用户猜的序列,统计有多少数字位置正确(A),有多少数字在两个序列都出现过但位置不对(B)输入包含多组数据。每组输入第一行为序列长度n,第二行是答案序列,接下来是若干猜测序列。猜测序列全0时该数组数据结束。n=0时输入结束。样例输入41 3 5 51 1 2 30 0 0 0101 2 2 2 4 5...

2018-07-24 20:56:33 518

原创 Python学习笔记-DAY13

分布式进程:正则表达式:在正则表达式中,如果直接给出字符,就是精确匹配。用\d可以匹配一个数字,\w可以匹配一个字母或数字,所以:'00\d'可以匹配'007',但无法匹配'00A'; '\d\d\d'可以匹配'010'; '\w\w\d'可以匹配'py3';.可以匹配任意字符,所以:'py.'可以匹配'pyc'、'pyo'、'py!'等等。要匹配变长的字符,在正则表达式中...

2018-07-24 20:03:33 171

libstdc++.so.6.0.22

libstdc++.so.6.0.22 主要用于解决ubuntu16.04 安装 matlabR2019b 中的错误 libstdc++.so.6: version `GLIBCXX_3.4.22' not found

2019-11-11

Graph cut 图割算法及使用样例

在matlab中打开文件夹 首先运行compile_gc.m文件 然后运行gc_example.m 得出结果。 再者可以运行graphcuts_demo.m文件得到结果。 再者可以运行graphcuts2.m文件得到结果。

2019-04-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除