Add Big O Notation Code

This commit is contained in:
Alex Hyett 2022-12-08 12:13:53 +00:00
parent 8f3bcc767c
commit c6de3b692b
9 changed files with 138 additions and 0 deletions

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Constant</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,23 @@
using System;
namespace Constant
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Constant Example");
Console.WriteLine("Another Line");
Console.WriteLine("Another Line");
Console.WriteLine("Another Line");
for (int i = 0; i < 10; i++)
{
Console.WriteLine(i);
}
}
}
}

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Exponential</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,21 @@
using System;
namespace Exponential
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine(fib(6));
}
static int fib(int num)
{
if (num <= 1) return num;
return fib(num - 2) + fib(num - 1);
}
}
}

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Linear</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,25 @@
using System;
namespace Linear
{
internal class Program
{
static void Main(string[] args)
{
var n = 10;
for (int i = 0; i < n; i++)
{
Console.WriteLine(i);
}
for (int i = 0; i < n; i++)
{
Console.WriteLine(i);
}
}
}
}

View file

@ -0,0 +1,24 @@
using System;
namespace Quadratic
{
internal class Program
{
static void Main(string[] args)
{
var n = 10;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= i; j++)
{
Console.Write("0 ");
}
Console.WriteLine();
}
}
}
}

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Quadratic</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -8,6 +8,7 @@ I will add new code as soon as I am done editing the videos. So, you might find
| Date Published | Video | Link |
| -------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| 2022-12-09 | [Big O Notation](https://youtu.be/aIG48ldbpRI) | [code](2022-12-09-Big-O-Notation) |
| 2022-11-25 | [Stack vs Heap](https://youtu.be/5OJRqkYbK-4) | [code](2022-11-25-Stack-Vs-Heap) |
| 2022-11-11 | [Automate Your Life With Python (File Management Step By Step Example)](https://youtu.be/1dgnl7oCVTY) | [code](2022-11-11-Automate-Your-Life-With-Python/move-photos.py) |
| 2022-10-21 | [Bitwise Operators and WHY we use them](https://youtu.be/igIjGxF2J-w) | [code](2022-10-21-Bitwise-Operators-and-WHY-we-use-them) |