Data structure (C #): Sequential table

Source: Internet
Author: User

A linear table is a sequence of finite data elements. There are two kinds of linear table storage, sequential storage and chain storage.

To enable the linear table to support the same API, the following interfaces have been defined, respectively, using the CIS table and the linked list.

/*
* File   :  ILinerList.cs
* Author  :  Zhenxing Zhou
* Date   :  2008-12-06
* Blog   :  http://www.xianfen.net/
*/
using System.Collections.Generic;
namespace Xianfen.Net.DataStructure
{
   interface ILinearList<T> : IEnumerable<T>
   {
     void Add(T t);
     void AddHead(T t);
     void AddTail(T t);
     void Clear();
     int Count { get; }
     int Find(T t);
     T GetAt(int pos);
     T GetHead();
     T GetTail();
     void InsertAt(T t, int pos);
     bool IsEmpty { get; }
     void RemoveAll();
     void RemoveAt(int pos);
     void RemoveHead();
     void RemoveTail();
     void SetAt(int pos, T t);
   }
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.