摘要: Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example:Given the below binary tree, 1 ... 阅读全文
posted @ 2015-08-27 23:43 我的十八岁 阅读(125) 评论(0) 推荐(0)
摘要: 快速排序实现的方式大同小异,个人认为以下代码较其它实现版本更简洁明了,希望对总是抱怨记不住快排的朋友有所帮助。View Code 1 #include<stdio.h> 2 3 int partition(int A[], int m, int n) 4 { 5 int x = A[m]; 6 int i = m; 7 int j,temp; 8 for(j = m + 1; j <= n; j++) 9 {10 if(A[j] <= x)11 {12 i=i+1;13 ... 阅读全文
posted @ 2012-10-27 21:30 我的十八岁 阅读(95) 评论(0) 推荐(0)