Code Monkey home page Code Monkey logo

data-structures's Introduction

data structure in C / JavaScript / Python

基本数据结构的 C / javascript / python 实现

data structure list

  • linked list: 单链表
  • doubly linked list: 双链表
  • stack: 栈
  • queue: 队列
  • hash table: 哈希表
  • tree: 树
  • binary tree: 二叉树
  • binary search tree: 二叉搜索树
  • Heap: 二叉堆

ADT

List

  • length: 获取列表长度
  • contains: 检查列表中是否包含指定元素
  • append: 在列表末尾添加元素
  • prepend: 在列表开始添加元素
  • shift: 在列表开始移除元素
  • indexOf: 获取指定元素的索引
  • elementAt: 获取指定索引处的元素
  • insert: 在指定索引位置插入元素
  • change: 设置指定索引处元素的值
  • clear: 删除列表中的所有元素
  • log: 打印列表中的所有元素

DoublyLinkedList

  • 方法同 List

Stack

  • push
  • pop
  • isEmpty
  • clear

Queue

  • enqueue
  • dequeue
  • isEmpty
  • clear

HashTable

  • set
  • get
  • has
  • clear

Tree

  • insert: 插入指定节点
  • delete:删除指定节点
  • find:查找指定节点
  • preorderLog: 先序遍历
  • postorderLog: 后序遍历
  • log: 打印树中的所有元素

BinaryTree

  • insert: 插入指定节点
  • delete:删除指定节点
  • find:查找指定节点
  • preorderLog: 先序遍历
  • postorderLog: 后序遍历
  • log: 打印树中的所有元素

BST

  • insert: 插入指定节点
  • delete:删除指定节点
  • find:查找指定节点
  • findMin: 查找最小元素
  • findMax:查找最大元素
  • clear: 删除所有元素
  • log: 打印树中的所有元素

Heap

  • insert
  • deleteMin
  • log

Todos

  • 补全 js, python 实现的基本数据结构

data-structures's People

Contributors

caesarii avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.