由该引理可知,动态集合查询操作Search, Minimum, Maximum, Successor和Predecessor可在红黑树上在O ( l g ( n ) ) O(lg(n))O(lg(n))时间内执行(见12章二叉搜索书,该章笔记与c++实现预计下周完成)。虽然当给定一棵红黑树作为输入时,第12章的TreeInsert和TreeDelete的运行时间为O ( l g ( n ) ) O(...
1//用双端链表实现队列2/**3* 节点类4*/5classLinkQ {6privatelongdata;7publicLinkQ next;89publicLinkQ(longd) {10this.data =d;11}1213publicString toString() {14returnString.valueOf(this.data);15}16}17/**18* 双端链表类19*/20classFirstLastLink {21privateLinkQ first;22privateLinkQ last...
{TODO}
{TODO}
1 //用链表实现堆栈 2 /** 3 * 节点类 4 */ 5 class LinkS { 6 private long data; 7 public LinkS next; 8 9 public LinkS(long d) { 10 this.data = d; 11 } 12 13 ...
Java数据结构与算法(26) - ch12堆(堆实现) {TODO}
Java数据结构与算法(14) - ch06递归(栈实现杨辉三角) {TODO}