- 博客(13)
- 收藏
- 关注
转载 Leetcode79 Word Search
题目描述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 "adjacent" cells are those horizontally or ver...
2019-09-25 20:47:00
490
转载 剑指offer-08 二叉树的下一个节点
剑指offer第8题,本来想找leetcode上对应的题,后来没找到,直接去牛客网上刷了。题目描述:给定一个二叉树和其中的一个结点(pNode),请找出中序遍历顺序的下一个结点并且返回。注意,树中的结点不仅包含左右子结点,同时包含指向父结点的指针。分析我看到这道题的第一个想法,就是不用管左子树。因为中序遍历,左子树是之前访问过了,所以下一个节点只有两种可能。一、在右子树二、在...
2019-09-18 21:19:00
155
转载 LeetCode-105 Construct Binary Tree from Preorder and Inorder Traversal
题目描述Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.For example, givenpreorder =[3,9,20,15,7]inorder ...
2019-09-18 17:41:00
163
转载 C++负数类型转换,-1对256取模
最近在读C++ primer的时候,发现p32上写道:当我们赋给无符号类型一个超出它表示范围的值时,结果是初始值对无符号类型表示数值总数取模后的余数。因此,把-1赋值给8比特大小的unsigned char所得的结果是255。-1怎么取模?这里先明确一下取模和取余的区别:(百度百科)取模运算(“Module Operation”)和取余运算(“Complementation...
2019-09-18 15:18:00
652
转载 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 r...
2019-09-17 22:30:00
129
转载 C++实现单例
实现代码如下#include <iostream>using namespace std;class Singleon{private: Singleon(){ cout<<"调用构造函数了"<<endl;} static Singleon* instance;public: static Singleon ...
2019-09-15 10:18:00
129
转载 leetcode9 Palindrome Number(按进阶要求)
题目描述Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseE...
2019-09-01 21:10:00
137
转载 leetcode8 String to Integer
题目描述Implement atoi whichconverts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting...
2019-09-01 20:40:00
124
转载 leetcode4 Median of Two Sorted Arrays学习记录
学习了扁扁熊的题解:https://leetcode-cn.com/problems/median-of-two-sorted-arrays/solution/4-xun-zhao-liang-ge-you-xu-shu-zu-de-zhong-wei-shu/记录一下,顺便按自己的理解给代码加上注释#include <vector>#include <stdio...
2019-08-28 22:30:00
150
转载 trec 2019 fair ranking track
trec 2019 fair ranking track最近实验室要求参加trec 2019新出的track:fair ranking track。这里整理一下该任务的思想和要求。这次track主要为学术论文数据的排序。1 Protocol会给定一个query集合Q,其中\(q\in Q\)。对于每个请求,会有一个query q和一个文档集合\(D_q\)。你需要...
2019-08-17 22:09:00
499
转载 Lasso估计学习笔记(二)
先看Lasso估计学习笔记(一),这篇是续的上一篇转载于:https://www.cnblogs.com/HaoPengZhang/p/9940029.html
2018-11-10 17:33:00
398
转载 Lasso估计论文学习笔记(一)
最近课程作业让阅读了这篇经典的论文,写篇学习笔记。主要是对论文前半部分Lasso思想的理解,后面实验以及参数估计部分没有怎么写,中间有错误希望能提醒一下,新手原谅一下。1.整体思路 作者提出了一种收缩和选择方法Lasso,这是一种可以用于线性回归的新的估计方法。它具有子集选择和岭回归的各自的优点。像子集选择一样可以给出具有解释力的模型,又能像岭回归一样具有可导的特性,比较稳...
2018-11-10 17:28:00
930
转载 ubuntu下部署mongodb以及设置允许远程连接
最近因为项目原因需要在阿里云服务器上部署mongodb,网上查阅了一些资料,特此记录一下步骤1.运行apt-get install mongodb命令安装mongodb服务(如果提示找不到该package,说明apt-get的资源库版本比较旧,运行apt-get update来更新资源库)2.安装好后输入mongo测试如果成功进入mongo命令行界面就证明安装成功了...
2016-07-31 11:06:00
251
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人