单向链表是一种基础的数据结构,也是一种简单而灵活的数据结构,本文讨论单向链表的基本概念及实现方法,并着重介绍使用GLib的GSList实现单向链表的方法及步骤,本文给出了多个实际范例源代码,旨在帮助学习基于GLib编程的读者较快地掌握GSList的使用方法,本文程序在 ubuntu 20.04 下编译测试完成,gcc 版本号 9.4.0;本文适合初学者阅读。 1 单向链表及其实现 在文章《使用GLib进行C语言编程的实例》中,简单介绍了 GLib,建议阅读本文前先阅读这篇文章; 单向链表是一...
What are linked lists and how do we create them? Imagine we want to store our names in alphabetical order and maintain them in memory. We have two options, arrays or Linked Lists. In this article we will discuss linked lists and in a separate article...
TABLE OF CONTENTS. Prerequisites. What is a singly linked list? Types of linked lists. Why a linked list? Representation of a single linked list. Creating a node of a singly linked list. Creating a singly linked list. Conclusion. Prerequisi...