#include#include "stdlib.h"#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXSIZE 1000 // Define linear table Maximum capacity typedef int Status; typedef int ElemType; // Define the storage structure of the static linked list typedef struct{ ElemType data; // data field int curr; // store the index of the next node in the array} Node; // define the StaticLinkList typedef Node StaticLinkList[MAXSIZE] ;// First initialize a spare static table (actually an array) // L[0].curr = 1, L[1].curr = 2, L[2].curr = 3 .. .Status InitList(StaticLinkList L){ for(int i=0; i< MAXSIZE; i++){ L[i].curr = i+1;} // The current static linked list is empty, and the last element points to the next The index of an element is 0 (that is, it points to an element) L[MAXSIZE-1].curr = 0; return OK;}// Get the index of the free element and store the index in L[0].curr int GetBlankIndex(StaticLinkList L){ // L[0].curr always stores the index of free elements int blankIndex = L[0].curr; if (L[0].curr) L[0].curr = L[blankIndex].curr; return blankIndex;}Status ListInsert(StaticLinkList L, ElemType e){ int blankIndex = GetBlankIndex(L); L[blankIndex].data = e; return OK;}// Delete the i-th element Status ListDelete(StaticLinkList L, int i){ retu rn OK;}void Visit(StaticLinkList L){ int blankIndex = GetBlankIndex(L); for (int i = 1; i
[Data Structure] Implementation of Static Links (C Language Description)
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5067 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC