Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
set.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 James Roy <rruuaanng@outlook.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
26
27#ifndef ZEPHYR_INCLUDE_SYS_SET_H_
28#define ZEPHYR_INCLUDE_SYS_SET_H_
29
30#include <stdint.h>
31
37 struct sys_set_node *parent;
38 uint16_t rank;
40};
41
48static inline void sys_set_makeset(struct sys_set_node *node, uint16_t rank)
49{
50 node->parent = node;
51 node->rank = rank;
52}
53
61
72void sys_set_union(struct sys_set_node *node1, struct sys_set_node *node2);
73
75
76#endif /* ZEPHYR_INCLUDE_SYS_SET_H_ */
struct sys_set_node * sys_set_find(struct sys_set_node *node)
Find the root of the disjoint-set.
void sys_set_union(struct sys_set_node *node1, struct sys_set_node *node2)
Merge two nodes into the same disjoint-set.
static void sys_set_makeset(struct sys_set_node *node, uint16_t rank)
Initialize a disjoint-set.
Definition set.h:48
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Disjoint-set node structure.
Definition set.h:35