智乐兔

算法与数据结构

  • 开放 Hash 表 Java 代码

    开放 Hash 表 Java 代码

    开放 Hash 表 Java 代码 public class HashEntry {      private int key;      private int value;      HashEntry(int key, int value) {            this.key = key;  &n ...

    查看全文

  • Splay 树 Java 代码

    Splay 树 Java 代码

    Splay 树 Java 代码 /*** Implements a top-down splay tree.* Available at https://www.link.cs.cmu.edu/splay/* Author: Danny Sleator <sleator@cs.cmu.edu>* This code is in the public domain.*/class BinaryNode{    BinaryNode(Comparable theKey) {      &n ...

    查看全文

  • 红黑树 Java 代码

    红黑树 Java 代码

    红黑树 Java 代码 // RedBlackTree class//// CONSTRUCTION: with a negative infinity sentinel//// ******************PUBLIC OPERATIONS*********************// void insert( x )       --> Insert x// void remove( x )       --> Remove x (unimpl ...

    查看全文

  • AVL 树 Java 代码

    AVL 树 Java 代码

    AVL 树 Java 代码 public class AVLTree{int count;int[] datas;Node tree;int tall;int low;private void lRotate(Node t){  Node p=t.rChild;  int temp=p.data;  p.data=t.data;  t.data=temp;  t.rChild=p.rChild;  p.rChild=p.lChild;  p.lChild=t.lChild;  t.lChild=p;}pri ...

    查看全文

  • 二叉查找树 Java 代码

    二叉查找树 Java 代码

    二叉查找树 Java 代码 public class BSTNode {      private int value;      private BSTNode left;      private BSTNode right;      public BSTNode(int value) {         ...

    查看全文

  • 阶乘 Java 代码

    阶乘 Java 代码

    阶乘 Java 代码 // Factorial class///*Factorial recursive version java implementation*/public class Factorial{    // Evaluate n!    public static long factorial( int n )    {        if( n <= 1 )     ...

    查看全文

  • 队列(链表实现) Java 代码

    队列(链表实现) Java 代码

    队列(链表实现) Java 代码// ListQueue class//// CONSTRUCTION: with no initializer//// ******************PUBLIC OPERATIONS*********************// void enqueue( x )      --> Insert x// Object getFront( )     --> Return least recently inserted item// Object d ...

    查看全文

  • 队列(数组实现) Java 代码

    队列(数组实现) Java 代码

    队列(数组实现) Java 代码// ArrayQueue class//// CONSTRUCTION: with no initializer//// ******************PUBLIC OPERATIONS*********************// void enqueue( x )      --> Insert x// Object getFront( )     --> Return least recently inserted item// Object ...

    查看全文

  • 堆栈链表实现方式(C++)

    堆栈链表实现方式(C++)

    #include "StackLi.h" #include <iostream.h> /** * Construct the stack. */ template <class Object> Stack<Object>::Stack( ) { topOfStack = NULL; } /** * Copy constructor. */ template <class Object> Stack<Object>::Stack( const Stack<Object> & rh ...

    查看全文

  • 堆栈链表实现方式(java)

    堆栈链表实现方式(java)

    // ListStack class//// CONSTRUCTION: with no initializer//// ******************PUBLIC OPERATIONS*********************// void push( x )         --> Insert x// void pop( )            --> Remove most ...

    查看全文

  • 堆栈链表实现方式(C)

    堆栈链表实现方式(C)

    C实现:     #include "stackli.h"        #include "fatal.h"        #include <stdlib.h>        struct Node        {    &n ...

    查看全文

  • 堆栈数组实现方式(c、c++、java)

    堆栈数组实现方式(c、c++、java)

    堆栈数组实现方式C代码:     #include "stackar.h"        #include "fatal.h"        #include <stdlib.h>        #define EmptyTOS ( -1 )        #define ...

    查看全文

在线客服
在线客服 X

售前: 点击这里给我发消息
售后: 点击这里给我发消息

智乐兔官微