Skip to content

Commit

Permalink
Merge pull request #379 from nassipkali/main
Browse files Browse the repository at this point in the history
Fixed AVL Tree
  • Loading branch information
Konard committed Jun 8, 2023
2 parents 1e43096 + b10626c commit 396d85a
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 55 deletions.
14 changes: 9 additions & 5 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ list(APPEND LINKS_PLATFORM_EXTRA_FLAGS ${CONAN_USER_PLATFORM.HASHING_suggested_f

add_library(${PROJECT_NAME}.Library INTERFACE)
target_include_directories(${PROJECT_NAME}.Library INTERFACE ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}.Library INTERFACE /home/freephoenix888/Programming/LinksPlatform/Interfaces/cpp/Platform.Interfaces)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.collections.methods)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.collections)
target_include_directories(${PROJECT_NAME}.Library INTERFACE ~/Code/LinksPlatform/Interfaces/cpp/Platform.Interfaces)
#target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.collections.methods)
target_include_directories(${PROJECT_NAME}.Library INTERFACE ~/Code/LinksPlatform/Collections.Methods/cpp/Platform.Collections.Methods)
#target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.collections)
target_include_directories(${PROJECT_NAME}.Library INTERFACE ~/Code/LinksPlatform/Collections/cpp/Platform.Collections)

target_include_directories(${PROJECT_NAME}.Library INTERFACE ~/Code/LinksPlatform/Numbers/cpp/Platform.Numbers)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.threading)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::mio)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.memory)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.exceptions)
#target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.data)
target_include_directories(${PROJECT_NAME}.Library INTERFACE /home/freephoenix888/Programming/LinksPlatform/Data/cpp/Platform.Data)
target_include_directories(${PROJECT_NAME}.Library INTERFACE ~/Code/LinksPlatform/Data/cpp/Platform.Data)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.setters)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.ranges)
target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.interfaces)
#target_link_libraries(${PROJECT_NAME}.Library INTERFACE CONAN_PKG::platform.interfaces)

target_link_directories(${PROJECT_NAME}.Library INTERFACE ${CMAKE_CURRENT_LIST_DIR})
#target_link_libraries(${PROJECT_NAME}.Library INTERFACE doublets_ffi)
Expand Down
18 changes: 9 additions & 9 deletions cpp/Platform.Data.Doublets.Tests/Dynamic/GenericLinksTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
UsingStorage<DecoratedStorageType>(action);
}

TEST(GenericLinksTests, CrudTestWithSizeBalancedTrees)
TEST(DynamicGenericLinksTests, CrudTestWithSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestCrudOperations(storage); });
Expand All @@ -117,7 +117,7 @@
[](auto &&storage) { TestCrudOperations(storage); });
}

TEST(GenericLinksTests, RawNumbersCrudTestWithSizeBalancedTrees)
TEST(DynamicGenericLinksTests, RawNumbersCrudTestWithSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
Expand All @@ -129,15 +129,15 @@
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
}

TEST(GenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithSizeBalancedTrees)
TEST(DynamicGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithSizeBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
}

TEST(GenericLinksTests, CrudTestWithRecursionlessSizeBalancedTrees)
TEST(DynamicGenericLinksTests, CrudTestWithRecursionlessSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithRecursionlessSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestCrudOperations(storage); });
Expand All @@ -149,7 +149,7 @@
[](auto &&storage) { TestCrudOperations(storage); });
}

TEST(GenericLinksTests, RawNumbersCrudTestWithRecursionlessSizeBalancedTrees)
TEST(DynamicGenericLinksTests, RawNumbersCrudTestWithRecursionlessSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithRecursionlessSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
Expand All @@ -161,15 +161,15 @@
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
}

TEST(GenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithRecursionlessSizeBalancedTrees)
TEST(DynamicGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithRecursionlessSizeBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
}

TEST(GenericLinksTests, CrudTestWithAvlTrees)
TEST(DynamicGenericLinksTests, CrudTestWithAvlTrees)
{
UsingStorageWithExternalReferencesWithAvlTrees<std::uint8_t>(
[](auto &&storage) { TestCrudOperations(storage); });
Expand All @@ -181,7 +181,7 @@
[](auto &&storage) { TestCrudOperations(storage); });
}

TEST(GenericLinksTests, RawNumbersCrudTestWithAvlTrees)
TEST(DynamicGenericLinksTests, RawNumbersCrudTestWithAvlTrees)
{
UsingStorageWithExternalReferencesWithAvlTrees<std::uint8_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
Expand All @@ -193,7 +193,7 @@
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
}

TEST(GenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithAvlBalancedTrees)
TEST(DynamicGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithAvlBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
UsingStorage<DecoratedStorageType>(action);
}

TEST(SplitMemoryGenericLinksTests, CrudTestWithSizeBalancedTrees)
TEST(DynamicSplitMemoryGenericLinksTests, CrudTestWithSizeBalancedTrees)
{
UsingStorageWithoutExternalReferencesWithSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { return TestCrudOperations(storage); });
Expand All @@ -87,7 +87,7 @@
[](auto &&storage) { return TestCrudOperations(storage); });
}

TEST(SplitMemoryGenericLinksTests, RawNumbersCrudTestWithSizeBalancedTrees)
TEST(DynamicSplitMemoryGenericLinksTests, RawNumbersCrudTestWithSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithSizeBalancedTrees<std::uint8_t>([](auto &&storage) {
return TestRawNumbersCrudOperations(storage);
Expand All @@ -103,15 +103,15 @@
});
}

TEST(SplitMemoryGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithSizeBalancedTrees)
TEST(DynamicSplitMemoryGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithSizeBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
}

TEST(SplitMemoryGenericLinksTests, CrudTestWithRecursionlessSizeBalancedTrees)
TEST(DynamicSplitMemoryGenericLinksTests, CrudTestWithRecursionlessSizeBalancedTrees)
{
UsingStorageWithoutExternalReferencesWithRecursionlessSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { return TestCrudOperations(storage); });
Expand All @@ -123,7 +123,7 @@
[](auto &&storage) { return TestCrudOperations(storage); });
}

TEST(SplitMemoryGenericLinksTests, RawNumbersCrudTestWithRecursionlessSizeBalancedTrees)
TEST(DynamicSplitMemoryGenericLinksTests, RawNumbersCrudTestWithRecursionlessSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithRecursionlessSizeBalancedTrees<std::uint8_t>([](auto &&storage) {
return TestRawNumbersCrudOperations(storage);
Expand All @@ -139,7 +139,7 @@
});
}

TEST(SplitMemoryGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithRecursionlessSizeBalancedTrees)
TEST(DynamicSplitMemoryGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithRecursionlessSizeBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
Expand Down
46 changes: 23 additions & 23 deletions cpp/Platform.Data.Doublets.Tests/Static/GenericLinksTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}

template<std::integral TLinkAddress>
static void UsingStorageWithExternalReferencesWithAVLBalancedTrees(auto&& action)
static void UsingStorageWithExternalReferencesWithAvlBalancedTrees(auto&& action)
{
using namespace Platform::Memory;
using namespace Platform::Data::Doublets::Memory::United::Generic;
Expand All @@ -79,7 +79,7 @@
}

template <std::integral TLinkAddress>
static void UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAVLBalancedTrees(auto&& action)
static void UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlBalancedTrees(auto&& action)
{
using namespace Platform::Memory;
using namespace Platform::Data::Doublets::Memory::United::Generic;
Expand All @@ -93,7 +93,7 @@
UsingStorage<DecoratedStorageType>(action);
}

TEST(GenericLinksTests, CrudTestWithSizeBalancedTrees)
TEST(StaticGenericLinksTests, CrudTestWithSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestCrudOperations(storage); });
Expand All @@ -105,7 +105,7 @@
[](auto &&storage) { TestCrudOperations(storage); });
}

TEST(GenericLinksTests, RawNumbersCrudTestWithSizeBalancedTrees)
TEST(StaticGenericLinksTests, RawNumbersCrudTestWithSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
Expand All @@ -117,15 +117,15 @@
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
}

TEST(GenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithSizeBalancedTrees)
TEST(StaticGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithSizeBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithSizeBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
}

TEST(GenericLinksTests, CrudTestWithRecursionlessSizeBalancedTrees)
TEST(StaticGenericLinksTests, CrudTestWithRecursionlessSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithRecursionlessSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestCrudOperations(storage); });
Expand All @@ -137,7 +137,7 @@
[](auto &&storage) { TestCrudOperations(storage); });
}

TEST(GenericLinksTests, RawNumbersCrudTestWithRecursionlessSizeBalancedTrees)
TEST(StaticGenericLinksTests, RawNumbersCrudTestWithRecursionlessSizeBalancedTrees)
{
UsingStorageWithExternalReferencesWithRecursionlessSizeBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
Expand All @@ -149,43 +149,43 @@
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
}

TEST(GenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithRecursionlessSizeBalancedTrees)
TEST(StaticGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithRecursionlessSizeBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithRecursionlessSizeBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
}

TEST(GenericLinksTests, CrudTestWithAVLBalancedTrees)
TEST(StaticGenericLinksTests, CrudTestWithAvlBalancedTrees)
{
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint8_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestCrudOperations(storage); });
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint16_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint16_t>(
[](auto &&storage) { TestCrudOperations(storage); });
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint32_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint32_t>(
[](auto &&storage) { TestCrudOperations(storage); });
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint64_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint64_t>(
[](auto &&storage) { TestCrudOperations(storage); });
}

TEST(GenericLinksTests, RawNumbersCrudTestWithAVLBalancedTrees)
TEST(StaticGenericLinksTests, RawNumbersCrudTestWithAvlBalancedTrees)
{
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint8_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint8_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint16_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint16_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint32_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint32_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
UsingStorageWithExternalReferencesWithAVLBalancedTrees<std::uint64_t>(
UsingStorageWithExternalReferencesWithAvlBalancedTrees<std::uint64_t>(
[](auto &&storage) { TestRawNumbersCrudOperations(storage); });
}

TEST(GenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithAVLBalancedTrees)
TEST(StaticGenericLinksTests, MultipleRandomCreationsAndDeletionsTestWithAvlBalancedTrees)
{
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAVLBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAVLBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAVLBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAVLBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlBalancedTrees<std::uint8_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,16); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlBalancedTrees<std::uint16_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlBalancedTrees<std::uint32_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
UsingDecoratedWithAutomaticUniquenessAndUsagesResolutionWithAvlBalancedTrees<std::uint64_t>([] (auto&& storage) { return TestMultipleRandomCreationsAndDeletions(storage,100); });
}
}
Loading

0 comments on commit 396d85a

Please sign in to comment.