![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
Burette_Lee
多学习
展开
-
C/C++头文件中<>与“”的区别详解
在A题的时候,发现某道题可以用到上次的函数,就想起之前看到的如何调用其他文件的函数。在这里把看到的资料整理一下。总的来说,源文件在编译的时候,需要找到头文件,使用在“”包含的头文件中,函数时可以直接不声明的,直接是函数原型在头文件中,或者这些头文件的时候,打开并不能看懂一些标准库函数的原型~~~~(>_此外,调试的时候,如果只在源程序设置断点,头文件中的函数会直接运行;但如果同时也在头原创 2017-11-03 12:33:12 · 2868 阅读 · 0 评论 -
LeetCode-559. Maximum Depth of N-ary Tree
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 farthest leaf node.For example, given a 3-ary tree: ...原创 2018-08-01 12:02:44 · 570 阅读 · 0 评论 -
LeetCode-590. N-ary Tree Postorder Traversal
Given an n-ary tree, return the preorder traversal of its nodes' values.For example, given a 3-ary tree:Return its preorder traversal as: [1,3,5,6,2,4]. Note: Recursive solution is trivial, co...原创 2018-08-01 13:30:00 · 468 阅读 · 0 评论 -
LeetCode-709. To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1:Input: "Hello"Output: "hello"Example 2:Input: "here"Output: "here"E...原创 2018-08-01 16:53:12 · 222 阅读 · 0 评论 -
LeetCode-28. Implement strStr()
Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Example...原创 2018-08-01 17:46:09 · 139 阅读 · 0 评论 -
LeetCode-682. Baseball Game
You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of points you get in ...原创 2018-08-06 15:00:58 · 124 阅读 · 0 评论 -
LeetCode-844. Backspace String Compare
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.Example 1:Input: S = "ab#c", T = "ad#c"Output: trueExplanation: Bo...原创 2018-08-06 16:34:17 · 151 阅读 · 0 评论 -
LeetCode-739. Daily Temperatures
Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this ...原创 2018-08-06 17:05:16 · 162 阅读 · 0 评论 -
LeetCode-20. Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of b...原创 2018-08-07 13:45:31 · 83 阅读 · 0 评论 -
LeetCode-617. Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree...原创 2018-08-07 15:39:16 · 184 阅读 · 0 评论 -
LeetCode-701. Insert into a Binary Search Tree
Given the root node of a binary search tree (BST) and a value to be inserted into the tree, insert the value into the BST. Return the root node of the BST after the insertion. It is guaranteed that th...原创 2018-08-01 11:18:45 · 564 阅读 · 0 评论 -
LeetCode-657. Judge Route Circle
Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.The move sequence is represented by...原创 2018-08-01 10:51:37 · 113 阅读 · 0 评论 -
LeetCode-872. Leaf-Similar Trees
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.For example, in the given tree above, the leaf value sequence is (6, 7, 4...原创 2018-08-01 10:28:16 · 220 阅读 · 0 评论 -
LeetCode-94. Binary Tree Inorder Traversal
94. Binary Tree Inorder TraversalGiven a binary tree, return the inorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]二叉树的中序遍历,我用的C+...原创 2018-07-18 15:51:39 · 133 阅读 · 0 评论 -
LeetCode-100. Same Tree
100. Same TreeGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the sa...原创 2018-07-18 15:57:57 · 89 阅读 · 0 评论 -
LeetCode-101. Symmetric Tree
101. Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 ...原创 2018-07-18 16:04:43 · 107 阅读 · 0 评论 -
LeetCode-104. Maximum Depth of Binary Tree
104. Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Not...原创 2018-07-18 16:16:12 · 113 阅读 · 0 评论 -
LeetCode-113. Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Note: A leaf is a node with no children.Example:Given the below binary tree and sum = 22,...原创 2018-07-28 14:41:34 · 120 阅读 · 0 评论 -
LeetCode-235. Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between ...原创 2018-07-28 16:07:01 · 110 阅读 · 0 评论 -
LeetCode-102. Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 ...原创 2018-08-05 20:57:41 · 140 阅读 · 0 评论 -
LeetCode-637. Average of Levels in Binary Tree
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]Explanati...原创 2018-08-05 21:05:06 · 108 阅读 · 0 评论 -
LeetCode-107. Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15,7...原创 2018-08-05 21:19:15 · 127 阅读 · 0 评论 -
LeetCode-103. Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binary tree...原创 2018-08-05 21:42:05 · 101 阅读 · 0 评论 -
LeetCode-404. Sum of Left Leaves
Find the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24....原创 2018-07-28 11:27:45 · 114 阅读 · 0 评论 -
LeetCode-224. Basic Calculator
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty sp...原创 2018-08-08 01:34:45 · 111 阅读 · 0 评论