Advertisement

数据结构-C++编写(1)-数组链表

阅读量:

数据结构采用C++编程语言进行实现,并主要包含以下几个组成部分:首先是定义了LinearList.h抽象类用于描述线性表的数据结构;其次是创建了ArrayList.h头文件来实现数组链表的具体操作;最后在main.cpp源文件中包含了完整的程序代码和相关函数实现。

LinearList.h文件具体信息如下:

复制代码
 #ifndef INC_01_ARRAYLIST_LINEARLIST_H

    
 #define INC_01_ARRAYLIST_LINEARLIST_H
    
  
    
 #include 
    
    
    
    
    
     
    
     
    
 template 
    
     
    
     
    
      
    
      
    
 class LinearList {
    
 public:
    
     virtual ~LinearList() {};
    
     virtual bool empty() const = 0;
    
     virtual int size() const = 0;
    
     virtual T& get(int index) const = 0;
    
     virtual int i

全部评论 (0)

还没有任何评论哟~