- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 指针详解(第二篇)
先上例题 1、“` char *p={ “how are you”, “hello”, “what’s your name”};这里p的类型不是char*,而是char * *2、```char a[20]="my name is Jang"char *p=a;char** q=&p;printf("%p",**q);q++;printf("%p",**q);正确输出:第一
2017-03-15 17:55:35 462
原创 C++例题
1、C++与C的区别? C是面对过程的,C++是面对对象的,C是一个结构化语言,它的重点在于算法和数据结构。C程序的设计首要考虑的是如何通过一个过程,对输入(或环境条件)进行运算处理得到输出(或实现过程(事务)控制),而对于C++,首要考虑的是如何构造一个对象模型,让这个模型能够契合与之对应的问题域,这样就可以通过获取对象的状态信息得到输出或实现过程(事务)控制。 所以C与C++的最大区别在于它们
2017-03-14 20:10:36 640
原创 Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path
2017-03-13 10:16:18 404
原创 指针例题详解
void test2() { char string[10], str1[10]; int i; for(i=0; i<10; i++) { str1= 'a'; } strcpy( string, str1 ); }错误: 链接:https://www.nowcoder.com/questionTerminal/f8209ee66a1b43
2017-03-09 21:00:54 715
原创 Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2].Note: Recursive solution is trivia
2017-03-02 09:52:53 384
原创 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],
2017-03-02 09:51:24 304
原创 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
2017-03-02 08:28:44 268
原创 Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.class Solution {public: int minDepth(T
2017-03-01 19:17:13 305
原创 Maximum Depth of Binary Tree
Given 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.class Solution {public: int maxDepth(T
2017-03-01 19:12:16 343
原创 Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by
2017-03-01 19:11:24 355
原创 Binary Tree Paths
Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree:1 / \ 2 3 \ 5 All root-to-leaf paths are:[“1->2->5”, “1->3”]第一个错误版本class Solution {publi
2017-03-01 10:28:58 287
原创 Invert Binary Tree
Invert Binary Tree Add to List Description Submission Solutions Total Accepted: 154920 Total Submissions: 307555 Difficulty: Easy Contributors: Admin Invert a binary tree. 4/ \ 2 7
2017-03-01 08:57:37 263
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人