今天看到一到有意思的题

虽然和题意不大对(因为要位置变换,我这种想法不算真正的位置变换)但是感觉很有意思。
其实就是重载运算符
#pragma once
#define MAXSIZE 50
#include<string.h>
template <typename ElemType>
struct Sequence
{
public:
ElemType data[MAXSIZE];
int length;
ElemType& (Sequence::*Index)(int)= &Sequence::IndexR1;
Sequence

本文介绍了一种巧妙的方法,通过重载运算符实现顺序表的逆置,尽管不完全符合原题要求的位置变换,但展示了有趣的算法思路。
2951

被折叠的 条评论
为什么被折叠?



