这会被归类为"你好,世界!"的O(1)算法吗?
public class Hello1
{
public static void Main()
{
DateTime TwentyYearsLater = new DateTime(2035,01,01);
while ( DateTime.Now < TwentyYearsLater )
{
System.Console.WriteLine("It's still not time to print the hello ...");
}
System.Console.WriteLine("Hello, World!");
}
}
我正在考虑使用
DateTime TwentyYearsLater = new DateTime(2035,01,01);
while ( DateTime.Now < TwentyYearsLater )
{
// ...
}
将代码片段作为繁忙循环,每当有人要求某种复杂性的算法时,将其作为Jest 放入其中.这对吗?