LeetCode.CommunityToolKit 4.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package LeetCode.CommunityToolKit --version 4.1.2
                    
NuGet\Install-Package LeetCode.CommunityToolKit -Version 4.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LeetCode.CommunityToolKit" Version="4.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LeetCode.CommunityToolKit" Version="4.1.2" />
                    
Directory.Packages.props
<PackageReference Include="LeetCode.CommunityToolKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LeetCode.CommunityToolKit --version 4.1.2
                    
#r "nuget: LeetCode.CommunityToolKit, 4.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LeetCode.CommunityToolKit@4.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LeetCode.CommunityToolKit&version=4.1.2
                    
Install as a Cake Addin
#tool nuget:?package=LeetCode.CommunityToolKit&version=4.1.2
                    
Install as a Cake Tool

LeetCode.CommunityToolKit社区工具包

LeetCode C#刷算法题快速工具包

  1. 帮助您在编写算法是不必自己创建TreeNode类;

Definition

Namespace: LeetCode.CommunityToolKit Assembly: LeetCode.CommunityToolKit.dll

Examples

  • 代码
using System;
using System.Collections.Generic;
using System.Linq;
using LeetCode.CommunityToolKit.Models;;

namespace LeetCode
{
    /// <summary>
    /// 897. 递增顺序搜索树
    /// https://leetcode.cn/problems/increasing-order-search-tree/
    /// </summary>
    public class Solution897
    {

        List<int> list = new List<int>();
        Stack<TreeNode> stack = new Stack<TreeNode>();
        public TreeNode IncreasingBST(TreeNode root)
        {
            DFS(root);
            Array.ForEach(list.ToArray(), (x) =>
            {
                if (stack.Count > 0)
                {
                    var node = stack.Peek();
                    var right = new TreeNode(x);
                    node.right = right;
                    stack.Push(right);
                }
                else
                {
                    stack.Push(new TreeNode(x));
                }
            });
            var r = stack.Last();
            return r;
        }

        public void DFS(TreeNode root)
        {
            if (root == null)
                return;

            if (root.left != null)
                DFS(root.left);
            list.Add(root.val);
            if (root.right != null)
                DFS(root.right);
        }
    }
}


Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LeetCode.CommunityToolKit:

Package Downloads
LeetCode.Test.CommunityToolKit

LeetCode C#刷算单元测试社区工具包MSTest单元测试拓展工具包 1.Assert 集合相等拓展方法Assert.That.SequenceEqual2;2.判断两二叉树是否相等Assert.That.TreeNodeEqual

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.4 1,148 7/14/2022
4.1.3 591 7/12/2022
4.1.2 1,012 6/30/2022