This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Node TruncateByTraverseBF(Node root,int count) | |
{ | |
if (count <= 0) | |
return null; | |
if (count == 1) | |
{ | |
root.Children.Clear(); | |
return root; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
/// <summary> | |
/// The singleton`s implementation to Insert into any other class. | |
/// </summary> | |
/// <typeparam name="T">The class which will be turned into Singleton.</typeparam> | |
/// <param name="Action">Actions to be taken in the default constructor.</typeparam> | |
#define Singleton(T, Action) \ | |
protected: \ | |
T() { (Action)(); } \ |