ladybird/Userland/Libraries/LibC/bits/search.h

19 lines
489 B
C
Raw Normal View History

2021-09-27 00:50:51 +02:00
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
// This is technically an implementation detail, but we require this for testing.
// The key always has to be the first struct member.
struct search_tree_node {
2022-04-01 20:58:27 +03:00
void const* key;
2021-09-27 00:50:51 +02:00
struct search_tree_node* left;
struct search_tree_node* right;
};
2022-04-01 20:58:27 +03:00
struct search_tree_node* new_tree_node(void const* key);
2021-09-27 00:50:51 +02:00
void delete_node_recursive(struct search_tree_node* node);