1 2 3 4 5 ··· 35 下一页
摘要: 实现思路: 1.run:入口函数 以深入优先的顺序记录BB的序号,并记录每个BB中的指令序号到DFSNumber中; 1.1 hoistExpressions: hoist所有表达式,返回hoist的scalars和non-scalars的数目 两重循环,遍历每个bb和bb中的每条指令,然后依据指令 阅读全文
posted @ 2021-10-27 22:45 Run_For_Love 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1、一定要认真读懂题目,真正理解了题目最终的需求才可思考思路; 2、思考思路时,首先就需要尽量想到最全面的测试用例。然后思考思路时,一定要逻辑清晰,理清思路,考虑到各种情况。有些需要合并和分解的地方一定要想清楚。再者就一定要计算好时间和空间复杂度以及编码的复杂度,异常较大时肯定是思路上存在问题; 3 阅读全文
posted @ 2019-03-11 16:31 Run_For_Love 阅读(616) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-02-26 16:36 Run_For_Love 阅读(11) 评论(0) 推荐(0) 编辑
摘要: void BFSLayer(BinaryTreeNode* pRoot) { if(pRoot==nullptr) return; queue<BinaryTreeNode*> pNode; int curLayer=1,nextLayer=0; pNode.push(pRoot); while(! 阅读全文
posted @ 2019-02-25 18:41 Run_For_Love 阅读(195) 评论(0) 推荐(0) 编辑
摘要: void BFS(BinaryTreeNode* pRoot) { if(pRoot==nullptr) { cout<<"empty binary tree!"<<endl; return; } queue<BinaryTreeNode*>pNode; pNode.push(pRoot); whi 阅读全文
posted @ 2019-02-25 12:30 Run_For_Love 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1 #include"iostream" 2 #include"stdio.h" 3 using namespace std; 4 5 const int MAXN=1000; 6 const int INF=10000000; 7 8 template<typename T>class Stack 阅读全文
posted @ 2019-02-25 10:39 Run_For_Love 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 1 #include"iostream" 2 #include"stdio.h" 3 using namespace std; 4 5 void PrintMatrixInCircle(int** matrix,int rows,int columns,int start) 6 { 7 int en 阅读全文
posted @ 2019-02-25 09:42 Run_For_Love 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 真题链接:https://www.nowcoder.com/test/8537269/summary 第一题: 1 #include"iostream" 2 #include"algorithm" 3 #include"stdio.h" 4 using namespace std; 5 const 阅读全文
posted @ 2019-02-24 22:40 Run_For_Love 阅读(1162) 评论(0) 推荐(0) 编辑
摘要: 1 void MirrorIteratively(BinaryTreeNode* pRoot) 2 { 3 if(pRoot == nullptr) 4 return; 5 6 std::stack<BinaryTreeNode*> stackTreeNode; 7 stackTreeNode.pu 阅读全文
posted @ 2019-02-24 15:11 Run_For_Love 阅读(294) 评论(0) 推荐(0) 编辑
摘要: #include"iostream" #include"stdio.h" #include"math.h" using namespace std; struct BinaryTreeNode { double m_Value; BinaryTreeNode* m_pLeft; BinaryTree 阅读全文
posted @ 2019-02-24 11:07 Run_For_Love 阅读(163) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 35 下一页