Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narcle committed Apr 13, 2023
1 parent a0bdad7 commit 43c46dc
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Linear Data Structures.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Linear Data Structures", "Linear Data Structures\Linear Data Structures.csproj", "{D402A62E-E049-465B-92A3-4A5D3A3144F7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D402A62E-E049-465B-92A3-4A5D3A3144F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D402A62E-E049-465B-92A3-4A5D3A3144F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D402A62E-E049-465B-92A3-4A5D3A3144F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D402A62E-E049-465B-92A3-4A5D3A3144F7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1F6A6880-EB9B-4410-B747-11D34EC4ECCC}
EndGlobalSection
EndGlobal
11 changes: 11 additions & 0 deletions Linear Data Structures/Linear Data Structures.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Linear_Data_Structures</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
35 changes: 35 additions & 0 deletions Linear Data Structures/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections;

//
class MainClass
{
public static void Main(string[] args)
{
//2.
Console.WriteLine("N Integers (uses spaces between numbers):");
int[] arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
for (int i = (arr.Length-1); i > -1; i--)//read top to bottom
{
Console.WriteLine(arr[i]);
}

//7.
int[] array = { 10, 5, 10, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 11, 12, 12 };
var dict = new Dictionary<int, int>();

foreach (var value in array)
{
// When the key is not found, "count" will be initialized to 0
dict.TryGetValue(value, out int count);
dict[value] = count + 1;
}

foreach (var pair in dict)
Console.WriteLine("Value {0} counted {1} times.", pair.Key, pair.Value);
Console.ReadKey();

//9.
}

}

0 comments on commit 43c46dc

Please sign in to comment.