上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: 头文件 使用map应包含map头文件 map的定义和初始化 定义: map<int,int> m; 尖括号内第一个数据类型表示键的类型,第二个为值的数据类型 初始化: 方法一:直接指定键,并赋值 例1: 结果为: key:1value is:1000 方法二:插入键值对 例2: 结果为: key:1 阅读全文
posted @ 2019-10-11 16:53 程嘿嘿 阅读(4272) 评论(0) 推荐(0) 编辑
摘要: string的find()函数用于找出字母在字符串中的位置。 find(str,position) find()的两个参数: str:是要找的元素 position:字符串中的某个位置,表示从从这个位置开始的字符串中找指定元素。 可以不填第二个参数,默认从字符串的开头进行查找。 返回值为目标字符的位 阅读全文
posted @ 2019-10-11 15:23 程嘿嘿 阅读(39458) 评论(0) 推荐(1) 编辑
摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2019-10-11 14:56 程嘿嘿 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Medium Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O 阅读全文
posted @ 2019-10-11 14:30 程嘿嘿 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Easy Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second 阅读全文
posted @ 2019-10-10 10:13 程嘿嘿 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Easy Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthe 阅读全文
posted @ 2019-09-26 13:47 程嘿嘿 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Easy Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that 阅读全文
posted @ 2019-09-26 10:18 程嘿嘿 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Easy A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univalued. Example 1: Examp 阅读全文
posted @ 2019-09-24 16:42 程嘿嘿 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Easy A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcod 阅读全文
posted @ 2019-09-24 16:17 程嘿嘿 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Easy The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two precedin 阅读全文
posted @ 2019-09-24 11:22 程嘿嘿 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页