上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 45 下一页
摘要: ListNode* reverseList(ListNode* head) { ListNode* tail=NULL; ListNode* front=head; ListNode* curr=NULL; //先令curr指向front,front移动下一个,curr的next指向tail实现反转 阅读全文
posted @ 2022-10-06 11:47 lwx_R 阅读(14) 评论(0) 推荐(0)
摘要: ListNode* getKthFromEnd(ListNode* head, int k) { ListNode* fast=head; ListNode* slow=head; //因为头结点开始 所以要从1开始 for(int i=1;i<k;i++){ fast=fast->next; // 阅读全文
posted @ 2022-10-06 11:45 lwx_R 阅读(22) 评论(0) 推荐(0)
摘要: ListNode* deleteNode(ListNode* head, int val) { if(head->val == val){ head=head->next; return head; } ListNode* front=head->next; ListNode* tail=head; 阅读全文
posted @ 2022-10-06 11:44 lwx_R 阅读(53) 评论(0) 推荐(0)
摘要: 1.数据绑定 WXML中部分数据来自JS中的data 1.1 js中设置数据 data: { myName:"123", title:"weixin", content:"123000", arr:["str","lwx"],//数组 // 对象 obj:{name:"lwx",age:18}, d 阅读全文
posted @ 2022-10-05 18:31 lwx_R 阅读(79) 评论(0) 推荐(0)
摘要: 1.新建component 2.使用 2.1 在json中加入 "usingComponents": { "comp":"/components/comp/comp" } 2.2 html使用 <comp></comp> 3.自定义属性值 3.1 在自定义组件的js中 /** * 组件的属性列表 * 阅读全文
posted @ 2022-10-04 20:07 lwx_R 阅读(17) 评论(0) 推荐(0)
摘要: 1.bfs没法回溯,会出现应该能到达的位置被访问 2.多起点 struct pp{ int x; int y; int step; int vis[10][10]; }; int dx[4]={0,0,1,-1}; int dy[4]={1,-1,0,0}; int m; int n; int vi 阅读全文
posted @ 2022-10-04 19:32 lwx_R 阅读(40) 评论(0) 推荐(0)
摘要: 由小至大推导公式,从2段开始一直到n段 int cuttingRope(int n) { //dp[i-j]*j 分为多段 //i-j *j 分为俩端 int dp[n+1]; memset(dp,0,sizeof(dp)); dp[2]=1; for(int i=3;i<=n;i++){ cout 阅读全文
posted @ 2022-10-04 19:21 lwx_R 阅读(24) 评论(0) 推荐(0)
摘要: 1.递归 每次吧结果相乘 //递归快速幂 double myPow(double x, long long n) { //x x2 x4 x8 x16*x if(n >= 0){ return quickPow(x,n); }else{ //n为负数情况 n=-n; return 1.0/quick 阅读全文
posted @ 2022-10-04 19:17 lwx_R 阅读(34) 评论(0) 推荐(0)
摘要: vector<int> reversePrint(ListNode* head) { vector<int> ans; if(head==NULL){ return ans; } ListNode* cur=head; while(cur!=NULL){ ans.insert(ans.begin() 阅读全文
posted @ 2022-10-01 18:41 lwx_R 阅读(35) 评论(0) 推荐(0)
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), r 阅读全文
posted @ 2022-10-01 18:40 lwx_R 阅读(39) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 45 下一页