09 2018 档案
摘要:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l
阅读全文
摘要:转自:http://www.cnblogs.com/reanote/p/find_4th_in_64horse.html 第一步:全部马分8组,各跑一次,然后淘汰掉每组的后四名(8次); 第二步:取每组第一名进行一次比赛,然后淘汰最后四名所在组的所有马(1次): 分析:其实这时候红色区域的马也可以淘
阅读全文
摘要:Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac
阅读全文
摘要:1. 深度学习是当前很热门的机器学习算法,在深度学习中,涉及到大量的矩阵相乘,现在需要计算三个稠密矩阵A,B,C的乘积ABC,假设三个矩阵的尺寸分别为m*n,n*p,p*q,且 m<n<p<q,以下计算顺序效率最高的是() A. ABC B. (AC)B C. A(BC) D. 所有效率都相同 解答
阅读全文
摘要:1. 一个子类中含有其他类对象,则构造函数的顺序是? 先执行基类的(如果基类当中有虚基类,要先执行虚基类的,其他基类则按照声明派生类是的顺序依次执行),在执行成员对象的,最后执行自己的。 2.sprintf的使用,还有itoa(),ltoa(),ultoa(),gcvt(),ecvt();使用spr
阅读全文
摘要:1. 有哪些生成式模型,有哪些判决式模型? 判别式模型与生成式模型的区别 产生式模型(Generative Model)与判别式模型(Discrimitive Model)是分类器常遇到的概念,它们的区别在于: 对于输入x,类别标签y:产生式模型估计它们的联合概率分布P(x,y)判别式模型估计条件概
阅读全文
摘要:无论是计算机考研、计算机软件水平考试、计算机操作系统期末考试还是其他计算机岗位考试,P、V原语操作都是一个常考点。下面笔者总结了关于P、V操作的一些知识。 信号量是最早出现的用来解决进程同步与互斥问题的机制(也可实现进程通信),包括一个称为信号量的变量及对它进行的两个原语操作。信号量为一个整数,我们
阅读全文
摘要:Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two ind
阅读全文
摘要:1.通项公式:h(n)=C(n,2n)/(n+1)=(2n)!/((n!)*(n+1)!) = C(n, 2n) - C(n +1, 2n); 2.递推公式:h(n)=((4*n-2)/(n+1))*h(n-1); h(n)=h(0)*h(n-1)+h(1)*h(n-2)+...+h(n-1)*h(
阅读全文
摘要:二叉树是最常用的数据结构之一,笔者过去一直将关注点放在复杂的树结构(例如红黑树,自平衡树),认为那些才是树的重要应用,但当重新由基本看起,才发现树的基本定中就隐藏着树这一结构的精髓。尽管是些浅薄蠢笨的理解和推演,但笔者还是满怀兴奋的想要将它记录下来。 一、二叉树的定义 二叉树的定义不用多说,很多书本
阅读全文
摘要:Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled
阅读全文
摘要:Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the
阅读全文
摘要:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example:
阅读全文
摘要:除了普通迭代器,C++标准模板库还定义了几种特殊的迭代器,分别是插入迭代器、流迭代器、反向迭代器和移动迭代器,定义在<iterator>头文件中,下面主要介绍三种插入迭代器(back_inserter,inserter,front_inserter)的区别。 首先,什么是插入迭代器?插入迭代器是指被
阅读全文
摘要:Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta
阅读全文
摘要:Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl
阅读全文
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the
阅读全文
摘要:list::splice实现list拼接的功能。将源list的内容部分或全部元素删除,拼插入到目的list。 函数有以下三种声明: void splice ( iterator position, list<T,Allocator>& x ); void splice ( iterator posi
阅读全文
摘要:Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra
阅读全文
摘要:Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa
阅读全文
摘要:Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr
阅读全文
摘要:Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique q
阅读全文
摘要:Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s
阅读全文

浙公网安备 33010602011771号