|
坤坤荔枝小黑子 (zhonghaotian22006)
|
22ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:32:25 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
440 KiB |
|
447 Bytes |
2022-9-14 20:31:25 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:20:51 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:31:14 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
408 KiB |
|
447 Bytes |
2022-9-14 20:32:31 |
|
zhangheyi22006
|
23ms |
432 KiB |
|
362 Bytes |
2022-9-14 20:11:19 |
|
朱老师 (zyp)
|
23ms |
436 KiB |
|
465 Bytes |
2022-9-9 15:09:08 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
396 KiB |
|
447 Bytes |
2022-9-14 20:33:11 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:20:45 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:06:24 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:31:16 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:28:01 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
424 KiB |
|
447 Bytes |
2022-9-14 20:11:17 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:31:17 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
512 KiB |
|
447 Bytes |
2022-9-14 20:18:11 |
|
zhangheyi22006
|
23ms |
404 KiB |
|
362 Bytes |
2022-9-14 20:14:09 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
432 KiB |
|
447 Bytes |
2022-9-14 20:32:20 |
|
1396013295
|
23ms |
416 KiB |
|
426 Bytes |
2022-10-2 10:27:27 |
|
zhangheyi22006
|
23ms |
404 KiB |
|
362 Bytes |
2022-9-14 20:16:17 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
388 KiB |
|
447 Bytes |
2022-9-14 20:10:37 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
23ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:31:18 |
|
zhangheyi22006
|
24ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:09:16 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:30:25 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:20:41 |
|
zhangheyi22006
|
24ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:09:19 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
412 KiB |
|
447 Bytes |
2022-9-14 20:06:37 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:32:24 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
416 KiB |
|
447 Bytes |
2022-9-14 20:14:09 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
392 KiB |
|
447 Bytes |
2022-9-14 20:06:37 |
|
谭红中 (不知道)
|
24ms |
512 KiB |
|
428 Bytes |
2023-1-14 15:54:29 |
|
zhangheyi22006
|
24ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:21:13 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
24ms |
440 KiB |
|
447 Bytes |
2022-9-14 20:30:19 |
|
手搓STL stack 双向无环链表 _ 向量 2种实现方式: template <typename Map_Type> class Stack_l /* Stack _ List */ { private: struct Node { Map_Type Node_Data; Node *nextp, *lastp; Node(void) { nextp = 0; lastp = 0; } }; struct List_Data { unsigned int List_Size; Node *headp, *endp; List_Data(void) { List_Size = 0; headp = 0; endp = 0; } }Data; struct Vector_Data { Map_Type *headp, *lastp, *endp; void resize(unsigned int data_size) { Map_Type *newp = new Map_Type[data_size](); endp = newp + data_size - 1; lastp = newp + (data_size > lastp - headp ? lastp - headp : data_size); if (headp) delete[] headp; headp = newp; } Vector_Data(void) { headp = 0; lastp = 0; endp = 0; } }; public: unsigned int size(void) { return Data.List_Size; } Map_Type& top(void) { return Data.endp -> Node_Data; } void* data(void) { return &Data; } bool empty(void) { return !((bool)Data.headp); } Stack_l<Map_Type>& push(Map_Type push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& push(Map_Type& push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& push(Map_Type* push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = *push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& push(const Map_Type* push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = *(Map_Type*)push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& pop(void) { if (Data.headp) { if (Data.List_Size == 1u) { delete Data.headp; Data.List_Size = 0; Data.headp = 0; Data.endp = 0; } else { Data.endp = Data.endp -> lastp; delete Data.endp -> nextp; Data.endp -> nextp = 0; --Data.List_Size; } } return *this; } Stack_l<Map_Type>& clear(void) { while (Data.List_Size) { pop(); } return *this; } Stack_l<Map_Type>(void) { /* NULL */ } Stack_l<Map_Type>(unsigned int data_size, Map_Type map_data) { Data.List_Size = data_size; while (data_size--) { Node *nodep = new Node(); nodep -> Node_Data = map_data; if (Data.headp) { nodep -> lastp = Data.endp; Data.endp -> nextp = nodep; Data.endp = nodep; } else { Data.headp = nodep; Data.endp = nodep; } } } Stack_l<Map_Type>(Stack_l<Map_Type>& map_data) { if (!map_data.empty()) { List_Data *listp = (List_Data*)map_data.data(); Node *nodep = listp -> headp, *newp; for (unsigned int i = 0; i != listp -> List_Size; ++i, nodep = nodep -> nextp) { newp = new Node(); newp -> Node_Data = nodep -> Node_Data; if (Data.headp) { newp -> lastp = Data.endp; Data.endp -> nextp = newp; Data.endp = newp; } else { Data.headp = newp; Data.endp = newp; } } Data.List_Size = listp -> List_Size; } } Stack_l<Map_Type>& operator=(Stack_l<Map_Type>& copy_data) { if (copy_data.empty()) return *this; List_Data *listp = (List_Data*)copy_data.data(); Node *nodep = listp -> headp, *newp; for (unsigned int i = 0; i != listp -> List_Size; ++i, nodep = nodep -> nextp) { newp = new Node(); newp -> Node_Data = nodep -> Node_Data; if (Data.headp) { newp -> lastp = Data.endp; Data.endp -> nextp = newp; Data.endp = newp; } else { Data.headp = newp; Data.endp = newp; } } Data.List_Size = listp -> List_Size; return *this; } bool operator==(Stack_l<Map_Type>& cmp_data) { if (cmp_data.size() != Data.List_Size) return false; else if (cmp_data.empty() && (!Data.List_Size)) return true; Node *nodep1 = Data.headp, *nodep2 = ((List_Data*)cmp_data.data()) ->headp; for (unsigned int i = 0; i != Data.List_Size; ++i, nodep1 = nodep1 -> nextp, nodep2 = nodep2 ->nextp) { if (nodep1 -> Node_Data != nodep2 -> Node_Data) return false; } return true; } bool operator!=(Stack_l<Map_Type>& cmp_data) { if (cmp_data.size() == Data.List_Size) return false; else if (cmp_data.empty() && (!Data.List_Size)) return false; Node *nodep1 = Data.headp, *nodep2 = ((List_Data*)cmp_data.data()) ->headp; for (unsigned int i = 0; i != Data.List_Size; ++i, nodep1 = nodep1 -> nextp, nodep2 = nodep2 ->nextp) { if (nodep1 -> Node_Data != nodep2 -> Node_Data) return true; } return true; } ~Stack_l<Map_Type>(void) { clear(); } }; /* Stack _ List */ template <typename Map_Type> class Stack_v /* Stack _ Vector */ { private: struct Node { Map_Type Node_Data; Node *nextp, *lastp; Node(void) { nextp = 0; lastp = 0; } }; struct List_Data { unsigned int List_Size; Node *headp, *endp; List_Data(void) { List_Size = 0; headp = 0; endp = 0; } }; struct Vector_Data { Map_Type *headp, *lastp, *endp; void resize(unsigned int data_size) { Map_Type *newp = new Map_Type[data_size](); endp = newp + data_size - 1; lastp = newp + (data_size > lastp - headp ? lastp - headp : data_size); if (headp) delete[] headp; headp = newp; } Vector_Data(void) { headp = 0; lastp = 0; endp = 0; } }Data; public: unsigned int size(void) { return Data.lastp - Data.headp; } Map_Type& top(void) { return *(Data.lastp - 1); } void* data(void) { return &Data; } bool full(void) { if (!Data.headp) return true; return Data.endp + 1 == Data.lastp; } bool empty(void) { if (!Data.headp) return true; return Data.headp == Data.lastp; } Stack_v<Map_Type>& push(Map_Type push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& push(Map_Type& push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& push(Map_Type* push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = *push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& push(const Map_Type* push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = *(Map_Type*)push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& pop(void) { if (empty()) { if (Data.lastp - Data.headp > 1) Data.resize((Data.lastp - Data.headp) >> 1); else return *this; } else --Data.lastp; return *this; } Stack_v<Map_Type>(void) { /* NULL */ } Stack_v<Map_Type>(unsigned int data_size, Map_Type map_data) { while (data_size) { push(&map_data); --data_size; } } Stack_v<Map_Type>(Stack_v<Map_Type>& map_data) { Vector_Data *datap = (Vector_Data*)map_data.data(); for (unsigned int i = 0, k = map_data.size(); i != k; ++i) push(datap -> headp + i); } Stack_v<Map_Type>& operator=(Stack_v<Map_Type>& copy_data) { if (copy_data.empty()) clear(); else { Vector_Data *datap = (Vector_Data*)copy_data.data(); for (unsigned int i = 0, k = copy_data.size(); i != k; ++i) push(datap -> headp + i); } return *this; } bool operator==(Stack_v<Map_Type>& cmp_data) { if (size() != cmp_data.size()) return false; else if (empty() && cmp_data.empty()) return true; Vector_Data *datap = (Vector_Data*)cmp_data.data(); for (unsigned int i = 0, k = size(); i != k; ++i) { if (*(Data.headp + i) != *(datap ->headp + i)) return false; } return true; } bool operator!=(Stack_v<Map_Type>& cmp_data) { if (size() != cmp_data.size()) return true; else if (empty() && cmp_data.empty()) return false; Vector_Data *datap = (Vector_Data*)cmp_data.data(); for (unsigned int i = 0, k = size(); i != k; ++i) { if (*(Data.headp + i) != *(datap -> headp + i)) return true; } return false; } Stack_v<Map_Type>& clear(void) { delete[] Data.headp; Data.headp = 0; Data.lastp = 0; Data.endp = 0; return *this; } ~Stack_v<Map_Type>(void) { delete[] Data.headp; } }; /* Stack _ Vector */ int main(void) { return 0; } (22029-xys)
|
24ms |
6.8 MiB |
|
419 Bytes |
2023-6-12 20:40:38 |
|
wangruibo20xh
|
24ms |
512 KiB |
|
300 Bytes |
2022-6-12 13:26:15 |
|
zhangheyi22006
|
24ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:16:05 |
|
呵 (mohaoran)
|
24ms |
6.7 MiB |
|
486 Bytes |
2023-8-30 16:26:12 |
|
zhangheyi22006
|
25ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:21:12 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
25ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:06:26 |
|
zhangheyi22006
|
25ms |
512 KiB |
|
362 Bytes |
2022-9-14 20:11:14 |
|
源著校区-宋昊成 (马冬梅)
|
25ms |
6.9 MiB |
|
573 Bytes |
2023-11-18 15:25:31 |
|
zhangheyi22006
|
25ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:12:21 |
|
zhangheyi22006
|
25ms |
420 KiB |
|
362 Bytes |
2022-9-14 20:16:09 |
|
zhangheyi22006
|
26ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:14:04 |
|
爱情海校区—沙天一 (沙天一)
|
26ms |
7.1 MiB |
|
378 Bytes |
2023-7-9 9:25:52 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
26ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:12:18 |
|
zhangheyi22006
|
26ms |
420 KiB |
|
362 Bytes |
2022-9-14 20:16:14 |
|
zhangheyi22006
|
26ms |
384 KiB |
|
362 Bytes |
2022-9-14 20:09:19 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
26ms |
428 KiB |
|
447 Bytes |
2022-9-14 20:22:35 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
26ms |
412 KiB |
|
447 Bytes |
2022-9-14 20:32:24 |
|
刘老师 (图书管理员)
|
26ms |
384 KiB |
|
416 Bytes |
2022-7-15 10:03:01 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
27ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:18:11 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
27ms |
384 KiB |
|
447 Bytes |
2022-9-14 20:30:24 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
27ms |
404 KiB |
|
447 Bytes |
2022-9-14 20:32:25 |
|
zhangheyi22006
|
27ms |
392 KiB |
|
362 Bytes |
2022-9-14 20:08:05 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
28ms |
412 KiB |
|
447 Bytes |
2022-9-14 20:10:43 |
|
wangjun
|
28ms |
6.5 MiB |
|
574 Bytes |
2023-11-17 13:25:42 |
|
张智洋
|
31ms |
7.3 MiB |
|
387 Bytes |
2023-9-30 18:18:33 |
|
在煎鱼的肖大总铳 (肖宇航)
|
33ms |
7.2 MiB |
|
354 Bytes |
2023-12-24 11:12:33 |
|
Nico
|
39ms |
7 MiB |
|
353 Bytes |
2023-12-23 13:58:35 |
|
zyl
|
66ms |
824 KiB |
|
377 Bytes |
2024-1-25 10:06:30 |
|
煞笔笔
|
69ms |
544 KiB |
|
315 Bytes |
2024-4-4 11:12:37 |
|
123456789987654321
|
73ms |
764 KiB |
|
363 Bytes |
2024-2-18 12:00:19 |
|
向浚郗
|
77ms |
776 KiB |
C++11 |
389 Bytes |
2024-11-2 19:52:42 |
|
yuchenyi23017
|
77ms |
532 KiB |
|
362 Bytes |
2024-1-28 16:12:38 |
|
ReFly (NKZKY)
|
85ms |
764 KiB |
|
477 Bytes |
2024-2-1 17:33:10 |
|
wzzjnb2012
|
212ms |
4.2 MiB |
Python 3 |
312 Bytes |
2023-4-13 22:53:42 |