1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:47:46 +00:00

LibC: Implement tfind and tsearch

This commit is contained in:
Tim Schumacher 2021-09-27 00:50:51 +02:00 committed by Brian Gianforcaro
parent d045181375
commit 7448626bae
6 changed files with 265 additions and 0 deletions

View file

@ -0,0 +1,18 @@
/*
* 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 {
const void* key;
struct search_tree_node* left;
struct search_tree_node* right;
};
struct search_tree_node* new_tree_node(const void* key);
void delete_node_recursive(struct search_tree_node* node);