+ return list->next == list;
+}
+
+/* Returns true if 'list' has exactly 1 element, false otherwise. */
+bool
+list_is_singleton(const struct list *list)
+{
+ return list_is_short(list) && !list_is_empty(list);
+}
+
+/* Returns true if 'list' has 0 or 1 elements, false otherwise. */
+bool
+list_is_short(const struct list *list)
+{
+ return list->next == list->prev;