给定一个有 N 个顶点和 E 条边的无向图,请用 DFS 和 BFS 分别列出其所有的连通集。假设顶点从 0 到 ...[作者空间]
In 1953, David A. Huffman published his paper“A Method fo...[作者空间]
We have a network of computersand a list of bi-directiona...[作者空间]
A Binary Search Tree (BST) is recursively defined as a bi...[作者空间]
An AVL tree is a self-balancing binary search tree.In an ...[作者空间]
二叉搜索树给定一个插入序列就可以唯一确定一棵二叉搜索树。然而,一棵给定的二叉搜索树却可以由多种不同的插入序列得到。...[作者空间]
An inorder binary tree traversalcan be implemented in a n...[作者空间]
Given a tree,you are supposed to list all the leaves in t...[作者空间]
给定两棵树 T1 和 T2。如果 T1 可以通过若干次左右孩子互换就变成 T2,则我们称两棵树是 “同构” 的。例...[作者空间]
Given a stack which can keep M numbers at most. Push N nu...[作者空间]
Given a constant K and a singly linked list L, you are su...[作者空间]
include
include
// 在线方法求子项的最大和int maxSub(int a[],int N){int maxSum,thisS...[作者空间]