Git Product home page Git Product logo

array's Introduction

Golang Array 泛型数组

基于 golang 实现的泛型数组,支持动态扩容等特性。

Build Status Build Status

项目结构

.
├── README.md
├── array.go  //实现
├── array_test.go  //测试用例
└── example_array_test.go  //使用例子

功能

  • GetCapacity获取数组容量
  • GetSize获取数组长度
  • IsEmpty判断数组是否为空
  • AddFirst向数组头插入元素
  • AddLast向数组尾插入元素
  • Add在索引位置插入元素
  • Get获取索引元素
  • Set修改索引位置元素
  • Contains查找数组中是否有元素
  • Find通过索引查找数组,索引范围[0,n-1](未找到,返回 -1)
  • Remove删除 index 位置的元素,并返回
  • RemoveFirst删除数组首个元素
  • RemoveLast删除末尾元素
  • RemoveElement从数组中删除指定元素
  • Clear清空数组
  • PrintIn打印格式化

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.