Implement UUID generation in addPersonToList and ensure uniqueness across existing nodes
This commit is contained in:
@@ -26,6 +26,16 @@ typedef struct node
|
||||
struct node *next;
|
||||
} node_t;
|
||||
|
||||
/**
|
||||
* @brief Generates a unique identifier (UUID) for a new node in the linked list.
|
||||
*
|
||||
* This function traverses the linked list starting from the given head node
|
||||
* and generates a unique 16-bit unsigned integer identifier that does not
|
||||
* conflict with any existing UUIDs in the list.
|
||||
*
|
||||
* @param _head Pointer to the head node of the linked list.
|
||||
* @return A 16-bit unsigned integer representing the generated UUID.
|
||||
*/
|
||||
uint16_t generateUUID(node_t *_head);
|
||||
|
||||
uint16_t searchUUIDByName(node_t *_head);
|
||||
|
||||
Reference in New Issue
Block a user