#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> typedef struct AVLTree{ char name[31]; int nCount; int nHeight; struct AVLTree* pLeft; struct AVLTree* pRight; }AVLTree; int Max( int a, int b ); int Heig…
参考:http://www.cnblogs.com/skywang12345/p/3577479.html using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.Threading; using System.IO; using System.Collections; namespace Console…
平衡二叉树:对于任意一个节点,左子树和右子树的高度差不能超过1 package Date_pacage; import java.util.ArrayList; public class AVLTree<K extends Comparable<K>, V> { private class Node{ public K key; public V value; public Node left, right; public int height; public Node(K key…
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 ->…