數(shù)據(jù)結(jié)構(gòu)——線性表

本文貼出順序表碑幅、鏈表 的例子代碼热芹,以及實(shí)例通訊錄的代碼斋荞。
文中代碼均已在VS2015上測(cè)試陌僵,空指針均為nullptr(C++11)轴合。參考來源:慕課網(wǎng)

線性表

線性表是n個(gè)數(shù)據(jù)元素的有限序列。

  • 分類:順序表(即數(shù)組)碗短、鏈表(分為 靜態(tài)鏈表值桩、單鏈表、循環(huán)鏈表豪椿、雙向鏈表)

  • 應(yīng)用場(chǎng)景:通訊錄奔坟、一元多項(xiàng)式

順序表

前驅(qū)、后繼

BOOL InitList(List **list);//創(chuàng)建線性表
void DestroyList(List *list);//銷毀線性表
void CleanList(List *list);//清空線性表
BOOL ListEmpty(List *list);//判斷線性表是否是空
int ListLength(List *list);//獲取線性表長(zhǎng)度
BOOL GetElem(List *list,int i,Elem *e);//獲取指定元素
int LocateElem(List *list,Elem *e);//尋找第一個(gè)滿足e的數(shù)據(jù)元素的位序
BOOL PriorElem(List *list,Elem *currentElem,Elem *preElem);//獲取指定元素的前驅(qū)
BOOL NextElem(List *list,Elem *currentElem,Elem *nextElem);//獲取指定元素的后繼
BOOL ListInsert(List *list,int i,Elem *e);//在第i個(gè)位置上插入元素
BOOL ListDelete(List *list,int i,Elem *e);//刪除第i個(gè)位置的元素
void ListTraverse(List *list);//遍歷線性表

示例:

#ifndef MYLIST_H
#define MYLIST_H

/****************************/
/*順序表C++類[MyList.h]    */
/****************************/
class MyList
{
public:
    MyList(int size);
    ~MyList();
    void CleanList();
    bool ListEmpty();
    int ListLength();
    bool GetElem(int i, int *e);
    int LocateElem(int *e);
    bool PriorElem(int *currentElem, int *preElem);
    bool NextElem(int *currentElem, int *nextElem);
    bool ListInsert(int i, int *e);
    bool ListDelete(int i, int *e);
    void ListTraverse();
private:
    int *m_pList;
    int m_iSize;
    int m_iLength;
};

#endif // !MYLIST_H

/******************************/
/*順序表C++實(shí)現(xiàn)[MyList.cpp]   */
/******************************/
#include "MyList.h"
#include <iostream>
using namespace std;
MyList::MyList(int size)
{
    m_iSize = size;
    m_pList = new int[m_iSize];
    m_iLength = 0;
}

MyList::~MyList()
{
    delete []m_pList;
    m_pList = nullptr;
}

void MyList::CleanList()
{
    m_iLength = 0;
}

bool MyList::ListEmpty()
{
    //return m_iLength==0?true:false;
    if (m_iLength == 0)
    {
        return true;
    }
    return false;
}

int MyList::ListLength()
{
    return m_iLength;
}

bool MyList::GetElem(int i, int * e)
{
    if (i < 0 || i >= m_iLength)
    {
        return false;
    }
    else 
    {
        *e = m_pList[i];
        return true;
    }
}

int MyList::LocateElem(int * e)
{
    for (int i = 0;i < m_iLength;i++)
    {
        if (m_pList[i] == *e)
        {
            return i;
        }
    }
    return -1;
}

bool MyList::PriorElem(int * currentElem, int * preElem)
{
    int temp = LocateElem(currentElem);
    if (temp == -1)
    {
        return false;
    }
    else if (temp == 0)
    {
        return false;
    }
    else
    {
        *preElem = m_pList[temp - 1];
        return true;
    }
}

bool MyList::NextElem(int * currentElem, int * nextElem)
{
    int temp = LocateElem(currentElem);
    if (temp == -1)
    {
        return false;
    }
    else if (temp == m_iLength - 1)
    {
        return false;
    }
    else
    {
        *nextElem = m_pList[temp + 1];
        return true;
    }
}

bool MyList::ListInsert(int i, int * e)
{
    if (i<0 || i>m_iLength)
    {
        return false;
    }
    for (int k = m_iLength - 1;k >= i;k--)
    {
        m_pList[k + 1] = m_pList[k];
    }
    m_pList[i] = *e;
    m_iLength++;
    return true;
}

bool MyList::ListDelete(int i, int * e)
{
    if (i < 0 || i >= m_iLength)
    {
        return false;
    }
    *e = m_pList[i];
    for (int k = i;k < m_iLength - 1;k++)
    {
        m_pList[k] = m_pList[k + 1];
    }
    m_iLength--;
    return true;
}

void MyList::ListTraverse()
{
    for (int i = 0;i < m_iLength;i++)
    {
        cout << m_pList[i] << " ";
    }
    cout << endl;
}

/******************************/
/*順序表使用實(shí)例[Main.cpp]    */
/******************************/
#include "MyList.h"
#include <iostream>
using namespace std;

int main(void)
{
    int e1 = 3;
    int e2 = 5;
    int e3 = 7;
    int e4 = 2;
    int e5 = 9;
    int e6 = 1;
    int e7 = 8;
    int e8 = 10;
    int temp = -1;
    MyList *list1 = new MyList(10);
    list1->ListInsert(0, &e1);
    list1->ListInsert(1, &e2);
    list1->ListInsert(2, &e3);
    list1->ListInsert(3, &e4);
    list1->ListInsert(4, &e5);
    list1->ListInsert(5, &e6);
    list1->ListInsert(6, &e7);
    cout << list1->ListLength() << endl;
    list1->ListTraverse();
    /*cout << list1->ListEmpty() << endl;
    list1->CleanList();
    cout << list1->ListEmpty() << endl;
    list1->ListInsert(0, &e8);
    list1->ListTraverse();
    list1->ListDelete(0, &temp);
    cout << temp << endl;
    cout << list1->ListLength() << endl;*/


    if (list1->GetElem(0, &temp))
    {
        cout << temp << endl;
    }
    temp = 8;

    int m = list1->LocateElem(&temp);
    if(m!=-1)
    cout << m << endl;

    list1->PriorElem(&e4, &temp);
    cout <<temp<< endl;

    list1->NextElem(&e4, &temp);
    cout << temp << endl;

    delete list1;
    list1 = nullptr;
    return 0;
}

鏈表

結(jié)點(diǎn):頭結(jié)點(diǎn)搭盾、數(shù)據(jù)域咳秉、指針域。

分類:

鏈表

示例:

#ifndef MYLIST_H
#define MYLIST_H
/****************************/
/*單鏈表C++類[MyList.h]     */
/****************************/
#include "MyNode.h"
class MyList
{
public:
    MyList();
    ~MyList();
    void ClearList();
    bool ListEmpty();
    int ListLength();
    bool GetElem(int i,MyNode *pNode);
    int LocateElem(MyNode *pNode);
    bool PriorElem(MyNode *pCurrentNode, MyNode *pPreNode);
    bool NextElem(MyNode *pCurrentNode, MyNode *pNextNode);
    void ListTraverse();
    bool ListInsert(int i, MyNode *pNode);
    bool ListDelete(int i, MyNode *pNode);
    bool ListInsertHead(MyNode *pNode);
    bool ListInsertTail(MyNode *pNode);
private:
    MyNode *m_pList;
    int m_iLength;
};
#endif

/******************************/
/*單鏈表C++實(shí)現(xiàn)[MyList.cpp]   */
/******************************/
#include "MyList.h"
#include<iostream>
using namespace std;
MyList::MyList()
{
    m_pList = new MyNode;
    m_pList->data = 0;
    m_pList->next = nullptr;
    m_iLength = 0;
}

MyList::~MyList()
{
    ClearList();
    delete m_pList;
    m_pList = nullptr;
}

void MyList::ClearList()
{
    MyNode *currentNode = m_pList->next;
    while (currentNode != nullptr)
    {
        MyNode *temp = currentNode->next;
        delete currentNode;
        currentNode = temp;
    }
    m_pList->next = nullptr;
}

bool MyList::ListEmpty()
{
    if (m_iLength == 0)
    {
        return true;
    }
    return false;
}

int MyList::ListLength()
{
    return m_iLength;
}

bool MyList::GetElem(int i, MyNode * pNode)
{
    if (i < 0 || i >= m_iLength)
    {
        return false;
    }
    MyNode *currentNode = m_pList;
    MyNode *currentNodeBefore = nullptr;
    for (int k = 0;k <= i;k++)
    {
        currentNodeBefore = currentNode;
        currentNode = currentNode->next;
    }
    pNode->data = currentNode->data;
    return true;
}

int MyList::LocateElem(MyNode * pNode)
{
    MyNode *currentNode = m_pList;
    int count = 0;
    while (currentNode->next != nullptr)
    {
        currentNode = currentNode->next;
        if (currentNode->data == pNode->data)
        {
            return count;
        }
        count++;
    }
    return -1;
}

bool MyList::PriorElem(MyNode * pCurrentNode, MyNode * pPreNode)
{
    MyNode *currentNode = m_pList;
    MyNode *tempNode = nullptr;
    while (currentNode->next!=nullptr)
    {
        tempNode = currentNode;
        currentNode = currentNode->next;
        if (currentNode->data== pCurrentNode->data)
        {
            if (tempNode==m_pList)
            {
                return false;
            }
            pPreNode->data = tempNode->data;
            return true;
        }
    }
    return false;
}

bool MyList::NextElem(MyNode * pCurrentNode, MyNode * pNextNode)
{
    MyNode *currentNode = m_pList;
    while (currentNode->next!=nullptr)
    {
        currentNode = currentNode->next;
        if (currentNode->data == pCurrentNode->data)
        {
            if (currentNode->next == nullptr)
            {
                return false;
            }
            pNextNode->data = currentNode->next->data;
            return true;
        }
    }
    return false;
}

void MyList::ListTraverse()
{
    MyNode *currentNode = m_pList;
    while (currentNode->next!=nullptr)
    {
        currentNode = currentNode->next;
        currentNode->printNode();
    }
    cout << endl;
}

bool MyList::ListInsert(int i, MyNode * pNode)
{
    if (i<0 || i>m_iLength)
    {
        return false;
    }
    MyNode *currentNode = m_pList;
    for (int k=0;k<i;k++)
    {
        currentNode = currentNode->next;
    }
    MyNode *newNode = new MyNode;
    if (newNode==nullptr)
    {
        return false;
    }
    newNode->data = pNode->data;
    newNode->next = currentNode->next;
    currentNode->next = newNode;
    m_iLength++;
    return true;
}

bool MyList::ListDelete(int i, MyNode * pNode)
{
    if (i<0||i>=m_iLength)
    {
        return false;
    }
    MyNode *currentNode = m_pList;
    MyNode *currentNodeBefore = nullptr;
    for (int k = 0;k <= i;k++)
    {
        currentNodeBefore = currentNode;
        currentNode = currentNode->next;
    }
    currentNodeBefore->next = currentNode->next;
    pNode->data = currentNode->data;
    delete currentNode;
    currentNode = nullptr;
    m_iLength--;
    return true;
}

bool MyList::ListInsertHead(MyNode * pNode)
{
    MyNode *temp = m_pList->next;
    MyNode *newNode = new MyNode;
    if (newNode==nullptr)
    {
        return false;
    }
    newNode->data = pNode->data;
    m_pList->next = newNode;
    newNode->next = temp;
    m_iLength++;
    return true;
}

bool MyList::ListInsertTail(MyNode * pNode)
{
    MyNode *currentNode = m_pList;
    while (currentNode->next!=nullptr)
    {
        currentNode = currentNode->next;
    }
    MyNode *newNode = new MyNode;
    if (newNode==nullptr)
    {
        return false;
    }
    newNode->data = pNode->data;
    newNode->next = nullptr;
    currentNode->next = newNode;
    m_iLength++;
    return true;
}


/******************************/
/*結(jié)點(diǎn)類C++頭文件[MyNode.h]   */
/******************************/
#ifndef MYNODE_H
#define MYNODE_H
#include <iostream>
using namespace std;
class MyNode
{
public:
    int data;
    MyNode *next;
    void printNode();
};
#endif

/******************************/
/*結(jié)點(diǎn)類C++實(shí)現(xiàn)[MyNode.cpp]   */
/******************************/
#include "MyNode.h"
#include <iostream>
using namespace std;
void MyNode::printNode()
{
    cout << data << " ";
}

/******************************/
/*單鏈表使用實(shí)例[Main.cpp]    */
/******************************/
#include "MyList.h"
#include<iostream>
using namespace std;
int main()
{
    MyNode node1;
    node1.data = 1;
    MyNode node2;
    node2.data = 2;
    MyNode node3;
    node3.data = 3;
    MyNode node4;
    node4.data = 4;
    MyNode node5;
    node5.data = 5;

    MyList *pList = new MyList();
    //插入頭元素
    pList->ListInsertHead(&node1);
    pList->ListInsertHead(&node2);
    pList->ListInsertHead(&node3);
    pList->ListInsertHead(&node4);
    pList->ListInsertHead(&node5);
    //插入尾元素
    pList->ListInsertTail(&node1);
    pList->ListInsertTail(&node2);
    pList->ListInsertTail(&node3);
    pList->ListInsertTail(&node4);
    pList->ListInsertTail(&node5);
    pList->ListTraverse();
    //在某位置插入元素
    pList->ListInsert(1, &node5);
    pList->ListTraverse();

    MyNode temp;
    //刪除某位置元素
    pList->ListDelete(1, &temp);
    pList->ListTraverse();
    cout <<temp.data << endl;
    //取某位置元素
    pList->GetElem(1,&temp);
    cout << temp.data << endl;
    //取前驅(qū)
    pList->PriorElem(&node4, &temp);
    cout << temp.data << endl;
    //取后繼
    pList->NextElem(&node4, &temp);
    cout << temp.data << endl;
    //元素位置
    cout<<pList->LocateElem(&node5)<<endl;

    delete pList;
    pList = nullptr;
    return 0;
}

進(jìn)階(通訊錄實(shí)現(xiàn))

MyList.h

#ifndef MYLIST_H
#define MYLIST_H
#include "MyNode.h"
class MyList
{
public:
    MyList();
    ~MyList();
    void ClearList();
    bool ListEmpty();
    int ListLength();
    bool GetElem(int i,MyNode *pNode);
    int LocateElem(MyNode *pNode);
    bool PriorElem(MyNode *pCurrentNode, MyNode *pPreNode);
    bool NextElem(MyNode *pCurrentNode, MyNode *pNextNode);
    void ListTraverse();
    bool ListInsert(int i, MyNode *pNode);
    bool ListDelete(int i, MyNode *pNode);
    bool ListInsertHead(MyNode *pNode);
    bool ListInsertTail(MyNode *pNode);
private:
    MyNode *m_pList;
    int m_iLength;
};
#endif

MyList.cpp

#include "MyList.h"
#include "MyNode.cpp"http://不加總是報(bào)錯(cuò)(VS2015中)
#include<iostream>
using namespace std;
MyList::MyList()
{
    m_pList = new MyNode;
    //m_pList->data = 0;
    m_pList->next = nullptr;
    m_iLength = 0;
}

MyList::~MyList()
{
    ClearList();
    delete m_pList;
    m_pList = nullptr;
}

void MyList::ClearList()
{
    MyNode *currentNode = m_pList->next;
    while (currentNode != nullptr)
    {
        MyNode *temp = currentNode->next;
        delete currentNode;
        currentNode = temp;
    }
    m_pList->next = nullptr;
}

bool MyList::ListEmpty()
{
    if (m_iLength == 0)
    {
        return true;
    }
    return false;
}

int MyList::ListLength()
{
    return m_iLength;
}

bool MyList::GetElem(int i, MyNode * pNode)
{
    if (i < 0 || i >= m_iLength)
    {
        return false;
    }
    MyNode *currentNode = m_pList;
    MyNode *currentNodeBefore = nullptr;
    for (int k = 0;k <= i;k++)
    {
        currentNodeBefore = currentNode;
        currentNode = currentNode->next;
    }
    pNode->data = currentNode->data;
    return true;
}

int MyList::LocateElem(MyNode * pNode)
{
    MyNode *currentNode = m_pList;
    int count = 0;
    while (currentNode->next != nullptr)
    {
        currentNode = currentNode->next;
        if (currentNode->data == pNode->data)
        {
            return count;
        }
        count++;
    }
    return -1;
}

bool MyList::PriorElem(MyNode * pCurrentNode, MyNode * pPreNode)
{
    MyNode *currentNode = m_pList;
    MyNode *tempNode = nullptr;
    while (currentNode->next!=nullptr)
    {
        tempNode = currentNode;
        currentNode = currentNode->next;
        if (currentNode->data== pCurrentNode->data)
        {
            if (tempNode==m_pList)
            {
                return false;
            }
            pPreNode->data = tempNode->data;
            return true;
        }
    }
    return false;
}

bool MyList::NextElem(MyNode * pCurrentNode, MyNode * pNextNode)
{
    MyNode *currentNode = m_pList;
    while (currentNode->next!=nullptr)
    {
        currentNode = currentNode->next;
        if (currentNode->data == pCurrentNode->data)
        {
            if (currentNode->next == nullptr)
            {
                return false;
            }
            pNextNode->data = currentNode->next->data;
            return true;
        }
    }
    return false;
}

void MyList::ListTraverse()
{
    MyNode *currentNode = m_pList;
    while (currentNode->next!=nullptr)
    {
        currentNode = currentNode->next;
        currentNode->printNode();
    }
    cout << endl;
}

bool MyList::ListInsert(int i, MyNode * pNode)
{
    if (i<0 || i>m_iLength)
    {
        return false;
    }
    MyNode *currentNode = m_pList;
    for (int k=0;k<i;k++)
    {
        currentNode = currentNode->next;
    }
    MyNode *newNode = new MyNode;
    if (newNode==nullptr)
    {
        return false;
    }
    newNode->data = pNode->data;
    newNode->next = currentNode->next;
    currentNode->next = newNode;
    m_iLength++;
    return true;
}

bool MyList::ListDelete(int i, MyNode * pNode)
{
    if (i<0||i>=m_iLength)
    {
        return false;
    }
    MyNode *currentNode = m_pList;
    MyNode *currentNodeBefore = nullptr;
    for (int k = 0;k <= i;k++)
    {
        currentNodeBefore = currentNode;
        currentNode = currentNode->next;
    }
    currentNodeBefore->next = currentNode->next;
    pNode->data = currentNode->data;
    delete currentNode;
    currentNode = nullptr;
    m_iLength--;
    return true;
}

bool MyList::ListInsertHead(MyNode * pNode)
{
    MyNode *temp = m_pList->next;
    MyNode *newNode = new MyNode;
    if (newNode==nullptr)
    {
        return false;
    }
    newNode->data = pNode->data;
    m_pList->next = newNode;
    newNode->next = temp;
    m_iLength++;
    return true;
}

bool MyList::ListInsertTail(MyNode * pNode)
{
    MyNode *currentNode = m_pList;
    while (currentNode->next!=nullptr)
    {
        currentNode = currentNode->next;
    }
    MyNode *newNode = new MyNode;
    if (newNode==nullptr)
    {
        return false;
    }
    newNode->data = pNode->data;
    newNode->next = nullptr;
    currentNode->next = newNode;
    m_iLength++;
    return true;
}

MyNode.h

#ifndef MYNODE_H
#define MYNODE_H
#include "Person.h"
#include <iostream>
using namespace std;
class MyNode
{
public:
    Person data;
    MyNode *next;
    void printNode();
};
#endif

MyNode.cpp

#include "MyNode.h"
#include <iostream>
using namespace std;

void MyNode::printNode()
{
    cout << data << " ";
}

Person.h

#ifndef PERSON_H
#define PERSON_H

#include <string>
#include <ostream>
using namespace std;
class Person
{
    friend ostream &operator<<(ostream &out, Person &person);
public:
    string name;
    string phone;
    Person &operator=(Person &person);
    bool operator==(Person &person);
};
#endif // !PERSON_H

Person.cpp

#include "Person.h"

Person & Person::operator=(Person & person)
{
    this->name = person.name;
    this->phone = person.phone;
    return *this;
}

bool Person::operator==(Person &person)
{
    if (this->name == person.name&&this->phone == person.phone)
    {
        return true;
    }
    return false;
}

ostream & operator<<(ostream & out, Person & person)
{
    out << person.name << ":" << person.phone << " ";
    return out;
}

Main.cpp

#include "MyList.h"
#include<iostream>
using namespace std;
int menu()
{
    cout << "功能菜單" << endl;
    cout << "1.新建聯(lián)系人" << endl;
    //cout << "2.刪除聯(lián)系人" << endl;
    cout << "3.瀏覽通訊錄" << endl;
    cout << "4.退出通訊錄" << endl;
    int order;
    cout << "請(qǐng)輸入:" << ends;
    cin >> order;
    return order;
}
void createPerson(MyList *pList)
{
    MyNode node;
    Person person;
    cout << "請(qǐng)輸入姓名:" << ends;
    cin >> person.name;
    cout << "請(qǐng)輸入電話:" << ends;
    cin >> person.phone;
    node.data = person;
    pList->ListInsertTail(&node);
}
int main()
{

    int userOrder=0;
    MyList *pList = new MyList();
    while (userOrder != 4)
    {
        userOrder = menu();
        switch (userOrder)
        {
        case 1:
            createPerson(pList);
            break;
        case 2:
            break;
        case 3:
            cout << "liulan" << endl;
            pList->ListTraverse();
            break;
        case 4:
            exit(0);
        default:
            break;
        }
    }

    delete pList;
    pList = nullptr;
    return 0;
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末鸯隅,一起剝皮案震驚了整個(gè)濱河市澜建,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌蝌以,老刑警劉巖炕舵,帶你破解...
    沈念sama閱讀 216,496評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異跟畅,居然都是意外死亡咽筋,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,407評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門徊件,熙熙樓的掌柜王于貴愁眉苦臉地迎上來奸攻,“玉大人,你說我怎么就攤上這事虱痕《媚停” “怎么了?”我有些...
    開封第一講書人閱讀 162,632評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵部翘,是天一觀的道長(zhǎng)硝训。 經(jīng)常有香客問我,道長(zhǎng)新思,這世上最難降的妖魔是什么窖梁? 我笑而不...
    開封第一講書人閱讀 58,180評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮表牢,結(jié)果婚禮上窄绒,老公的妹妹穿的比我還像新娘。我一直安慰自己崔兴,他們只是感情好彰导,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,198評(píng)論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著敲茄,像睡著了一般位谋。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上堰燎,一...
    開封第一講書人閱讀 51,165評(píng)論 1 299
  • 那天掏父,我揣著相機(jī)與錄音,去河邊找鬼秆剪。 笑死赊淑,一個(gè)胖子當(dāng)著我的面吹牛爵政,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播陶缺,決...
    沈念sama閱讀 40,052評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼钾挟,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了饱岸?” 一聲冷哼從身側(cè)響起掺出,我...
    開封第一講書人閱讀 38,910評(píng)論 0 274
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎苫费,沒想到半個(gè)月后汤锨,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,324評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡百框,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,542評(píng)論 2 332
  • 正文 我和宋清朗相戀三年闲礼,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片琅翻。...
    茶點(diǎn)故事閱讀 39,711評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡位仁,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出方椎,到底是詐尸還是另有隱情聂抢,我是刑警寧澤,帶...
    沈念sama閱讀 35,424評(píng)論 5 343
  • 正文 年R本政府宣布棠众,位于F島的核電站琳疏,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏闸拿。R本人自食惡果不足惜空盼,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,017評(píng)論 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望新荤。 院中可真熱鬧揽趾,春花似錦、人聲如沸苛骨。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,668評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽痒芝。三九已至俐筋,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間严衬,已是汗流浹背澄者。 一陣腳步聲響...
    開封第一講書人閱讀 32,823評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人粱挡。 一個(gè)月前我還...
    沈念sama閱讀 47,722評(píng)論 2 368
  • 正文 我出身青樓赠幕,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親抱怔。 傳聞我的和親對(duì)象是個(gè)殘疾皇子劣坊,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,611評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容

  • 完整代碼需結(jié)合前面一篇順序表數(shù)據(jù)結(jié)構(gòu)學(xué)習(xí)-線性表之順序表各種操作網(wǎng)易云課堂小甲魚課程鏈接:數(shù)據(jù)結(jié)構(gòu)與算法 線性表的...
    NotFunGuy閱讀 9,179評(píng)論 0 9
  • 定義:零個(gè)或多個(gè)數(shù)據(jù)元素的有限序列 線性表的順序存儲(chǔ)的結(jié)構(gòu)代碼。 這里屈留,我們就發(fā)現(xiàn)描述順序存儲(chǔ)結(jié)構(gòu)需要三個(gè)屬性: ...
    大榮言午閱讀 398評(píng)論 2 0
  • 基礎(chǔ)概念 數(shù)據(jù)結(jié)構(gòu)的分類 在數(shù)據(jù)結(jié)構(gòu)中,按照不同的角度测蘑,數(shù)據(jù)結(jié)構(gòu)分為邏輯結(jié)構(gòu)和物理結(jié)構(gòu)(存儲(chǔ)結(jié)構(gòu))灌危。 邏輯結(jié)構(gòu):指...
    IAM四十二閱讀 1,099評(píng)論 2 5
  • 本文主要內(nèi)容:線性表的邏輯結(jié)構(gòu)和存儲(chǔ)結(jié)構(gòu)以及相應(yīng)算法; 1. 定義和特點(diǎn) 1. 定義: 由N(N>=0)個(gè)數(shù)據(jù)特性...
    Lost_Robot閱讀 568評(píng)論 0 0
  • 身體壯實(shí)碳胳、肌肉凸起的人脾氣急躁勇蝙,心寬的人脾氣和順。為人深沉挨约、話少的人有福味混。心有志向的人,性格剛?cè)岵?jì)诫惭。要親善就多接...
    小柑橘閱讀 1,042評(píng)論 0 0