Pascal 中的链表
我正在寻找 Pascal 中链表的良好且简单的实现。 作为一个 Pascal 初学者,它作为学习材料对我有很大帮助。
感谢您的任何提示。
Im looking for a good and simple implementation of a linked list in Pascal.
As Im a Pascal beginner it would help me alot as a study material.
Thanks for any tips.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在旧邮件中发现了我们已经完成的实现。代码是“法语”,所以我不会碰它,以免忘记某个会破坏编译的函数:-)
首先,我们有一个“元素”类型,让我们可以轻松地更改我们想要的内容存储在列表中:
然后,实际的列表模块,旨在在列表的开头添加元素:
和一个小测试程序:
正如我所说,这是一个旧的(非常旧的)程序,当我开始学习 CS,所以它可能不适合:-),但我认为它有助于语法和全局思想。
I have found back in my old mails an implementation we had done. The code is "in french" so I won't touch it in order not to forget a function somewhere which would break the compilation :-)
First of all, we have an "element" type, to let us easily change what we want to store in the list:
Then, the actual list module, which is designed to add elements at the beginning of the list:
And a small test program:
As I said, this is an old (very old) program made when I started learning CS, so it may not fit :-), but I think it helps with the syntax and the global idea.
好文章: http://www.learn-programming.za.net/programming_pascal_learn14.html
网站似乎已关闭。在这里你可以找到-> 存档版本
Good article: http://www.learn-programming.za.net/programming_pascal_learn14.html
Website seems to be down. Here you can find -> Archived Version