- 博客(10)
- 收藏
- 关注
原创 2021-08-10 str
int fib(int n) { if(n==0) return 0; if(n==1||n==2) return 1; int a=0,b=1,c=0; for(int i=0;i<n;i++){ a=b,b=c; c=(a+b)%1000000007; } return c; }10intnumWays(intn){...
2021-08-10 06:06:22
128
原创 2021-05-28
2021/5/8理解cookie,session,tokenhttps://zhuanlan.zhihu.com/p/63061864user_name可能重名,session_id是唯一的user_name可以猜,可能会有安全问题session_id有24位,不容易被试出来cookie 是一个非常具体的东西,指的就是浏览器里面能永久存储的一种数据,仅仅是浏览器实现的一种数据存储功能。cookie由服务器生成,发送给浏览器,浏览器把cookie以kv形式保存到某个目录下的文本文件内,下一次请求
2021-05-28 16:12:44
111
原创 jianzhioffer
生命周期每个Vue实例在被创建之前都要经过一系列的初始化过程,这个过程就是vue的生命周期。钩子函数提供给我们在vue生命周期不同的时刻进行操作:https://segmentfault.com/a/1190000011381906beforeCreate初始化事件,和data进行绑定,没有el optioncreated判断是否有el选项,有的话继续编译没有el则停止编译,暂停生命周期,直到调用vm.$mount(el) ,生命周期继续,代码继续向下执行vue通过el找对应的outer
2021-04-15 21:05:14
151
原创 2020-10-06 greedy algorithm
greedy algorithmclass Solution {public: int findContentChildren(vector<int>& g, vector<int>& s) { sort(g.begin(),g.end()); sort(s.begin(),s.end()); int i=0,j=0; while(i<g.size()&&j<s.s
2020-11-11 14:44:33
71
原创 2020-10-08 queue and stack
leetcode stack and queue10-08my queuemy stackstack and queue10-08my queueclass MyQueue {public: stack<int> input,output; /** Initialize your data structure here. */ MyQueue() { } /** Push element x to the b
2020-11-11 14:44:11
627
原创 10-06 binary tree
leetcode linked listintro1. max depth2. Balanced tree(?)3.Diameter of Binary Tree(?)4 invert a binary tree(?)add two binary treetreeintro树是一种递归结构,很多树的问题可以使用递归来处理。1. max depthDepth-first-searchint maxDepth(TreeNode *root){ return root == NULL ? 0
2020-11-10 14:01:04
123
原创 2020-10-05 leetcode binary search
leetcode binary searchintrosqrt744. Find Smallest Letter Greater Than Target (?)540. Single Element in a Sorted Array (?)reference: binary searchintro//here code is in Java not C++public int binarySearch(int[] nums, int key) {//search for key in nums
2020-10-07 11:34:44
62
原创 leetcode--linked list
from this sourcelinked list 题解找交点class Solution {public: ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { ListNode *l1 = headA, *l2 = headB; //while two ptrs doesn't meet while (l1 != l2) { l1 = (l
2020-10-05 17:37:05
124
原创 Caffe2 MNIST tutorial: 2 problems that I met
1. When running this line of code: data_uint8, label = model.TensorProtosDBInput( [], ["data_uint8", "label"], batch_size=batch_size, db=db, db_type=db_type)We have :AttributeError: 'module' object has no attribute 'db_input'This c
2020-07-26 17:33:36
136
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人