上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 22 下一页
摘要: 1. 以引用或指针形式传入: cpp void foo(std::vector<int> &vec); // 以引用形式传入 void bar(std::vector<int> *ptr); // 以指针形式传入 这种方式不会复制vec,函数内操作的是vec本身。可以改变vec。例如: cpp st 阅读全文
posted @ 2023-05-21 10:36 Yohoc 阅读(1174) 评论(0) 推荐(0)
摘要: 题目: Given a non-empty tree with root R, and with weight Wi​assigned to each tree node Ti​. The weight of a path from R to L is defined to be the sum o 阅读全文
posted @ 2023-05-21 10:35 Yohoc 阅读(45) 评论(0) 推荐(0)
摘要: 题目: The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree 阅读全文
posted @ 2023-05-20 11:46 Yohoc 阅读(25) 评论(0) 推荐(0)
摘要: 题目: An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with 阅读全文
posted @ 2023-05-20 11:01 Yohoc 阅读(20) 评论(0) 推荐(0)
摘要: 题目: A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to fi 阅读全文
posted @ 2023-05-20 09:34 Yohoc 阅读(21) 评论(0) 推荐(0)
摘要: 二维都变长的二维容器数组 1、在C++中,可以这样初始化一个二维vector数组并指定大小: cpp vector<vector<int>> vec(3, vector<int>(4)); 这个代码会创建一个3行4列的二维vector数组,每个元素初始化为0:vec = [0 0 0 0][0 0 阅读全文
posted @ 2023-05-18 14:08 Yohoc 阅读(10587) 评论(1) 推荐(0)
摘要: 题目: Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed t 阅读全文
posted @ 2023-05-16 09:48 Yohoc 阅读(25) 评论(0) 推荐(0)
摘要: One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions 阅读全文
posted @ 2023-05-15 22:22 Yohoc 阅读(20) 评论(0) 推荐(0)
摘要: 题目: The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a progr 阅读全文
posted @ 2023-05-14 13:52 Yohoc 阅读(20) 评论(0) 推荐(0)
摘要: 题目: Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a soci 阅读全文
posted @ 2023-05-14 10:51 Yohoc 阅读(20) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 22 下一页