Add Big O Notation Code
This commit is contained in:
parent
8f3bcc767c
commit
c6de3b692b
9 changed files with 138 additions and 0 deletions
11
2022-12-09-Big-O-Notation/Constant/Constant.csproj
Normal file
11
2022-12-09-Big-O-Notation/Constant/Constant.csproj
Normal 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>
|
23
2022-12-09-Big-O-Notation/Constant/Program.cs
Normal file
23
2022-12-09-Big-O-Notation/Constant/Program.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
11
2022-12-09-Big-O-Notation/Exponential/Exponential.csproj
Normal file
11
2022-12-09-Big-O-Notation/Exponential/Exponential.csproj
Normal 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>
|
21
2022-12-09-Big-O-Notation/Exponential/Program.cs
Normal file
21
2022-12-09-Big-O-Notation/Exponential/Program.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
11
2022-12-09-Big-O-Notation/Linear/Linear.csproj
Normal file
11
2022-12-09-Big-O-Notation/Linear/Linear.csproj
Normal 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>
|
25
2022-12-09-Big-O-Notation/Linear/Program.cs
Normal file
25
2022-12-09-Big-O-Notation/Linear/Program.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
24
2022-12-09-Big-O-Notation/Quadratic/Program.cs
Normal file
24
2022-12-09-Big-O-Notation/Quadratic/Program.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
11
2022-12-09-Big-O-Notation/Quadratic/Quadratic.csproj
Normal file
11
2022-12-09-Big-O-Notation/Quadratic/Quadratic.csproj
Normal 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>
|
|
@ -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) |
|
||||
|
|
Loading…
Reference in a new issue