public SortResults Estimate(EnumArraySortAlgorithms sortAlgorithm, EnumArrayDataProviders searchDataProvider)
    {
        var _sort       = GetSort(sortAlgorithm);
        var _searchData = new DataProvidersFactory(SampleSize).GetProvider(searchDataProvider);

        return(_sort.Sort(_searchData.Data));
    }
예제 #2
0
    public BinaryTreeEstimation Estimate(EnumTreeTypes treeType)
    {
        var _tree     = GetTree(treeType);
        var _treeData = new DataProvidersFactory(SampleSize).GetProvider(treeType == EnumTreeTypes.BST ? EnumTreeDataProvider.BST : EnumTreeDataProvider.Heap);

        return(new BinaryTreeEstimation()
        {
            Deserialize = _tree.CreateTree(_treeData.Data),
            Search = _tree.Search(_treeData.Tree, _treeData.AvgValue),
            Insert = _tree.Insert(_treeData.Tree, _treeData.NotFoundValue),
        });
    }
예제 #3
0
    public SearchResults Estimate(EnumArraysSearchAlgorithms searchAlgorithm, EnumArrayDataProviders searchDataProvider)
    {
        var _search     = GetSearch(searchAlgorithm);
        var _searchData = new DataProvidersFactory(SampleSize).GetProvider(searchDataProvider);

        var searchResults = new SearchResults()
        {
            ArrayCount = _searchData.Data.Count
        };

        searchResults.MinValue      = _search.Find(_searchData.Data, _searchData.MinValue);
        searchResults.AvgValue      = _search.Find(_searchData.Data, _searchData.AvgValue);
        searchResults.MaxValue      = _search.Find(_searchData.Data, _searchData.MaxValue);
        searchResults.RandomValue   = _search.Find(_searchData.Data, _searchData.RandomValue);
        searchResults.NotFoundValue = _search.Find(_searchData.Data, _searchData.NotFoundValue);

        return(searchResults);
    }