added orai

This commit is contained in:
szabomarton 2024-11-22 10:45:16 +01:00
parent d802eb4b67
commit 630904fdf1
38 changed files with 504 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,41 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{529FE57B-DB53-4420-9E47-6FC259D3CDA8}|ConsoleApp1\\ConsoleApp1.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20241122\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{529FE57B-DB53-4420-9E47-6FC259D3CDA8}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AgIAADwAAAAAAAAAAAAkwFUAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-11-22T09:04:52.451Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
}
]
}
]
}
]
}

View File

@ -0,0 +1,41 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{529FE57B-DB53-4420-9E47-6FC259D3CDA8}|ConsoleApp1\\ConsoleApp1.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20241122\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{529FE57B-DB53-4420-9E47-6FC259D3CDA8}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AgIAADwAAAAAAAAAAAAkwFUAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-11-22T09:04:52.451Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
}
]
}
]
}
]
}

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{529FE57B-DB53-4420-9E47-6FC259D3CDA8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{529FE57B-DB53-4420-9E47-6FC259D3CDA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{529FE57B-DB53-4420-9E47-6FC259D3CDA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{529FE57B-DB53-4420-9E47-6FC259D3CDA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{529FE57B-DB53-4420-9E47-6FC259D3CDA8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5611284C-AF12-4EA7-A777-BA889405F9FB}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,87 @@
public class Verem<T>
{
private T[] elemek;
private int meret;
private int teteje;
public Verem(int kapacitas)
{
elemek = new T[kapacitas];
meret = kapacitas;
teteje = -1;
}
public void Push(T adat)
{
if (teteje == meret - 1)
{
Console.WriteLine("A verem tele van");
return;
}
elemek[++teteje] = adat;
}
public T Pop() {
if (Ures())
{
Console.WriteLine("A verem üres, nincs mit eltávolítani.");
return default;
}
return elemek[teteje--];
}
public T Peek()
{
if (Ures())
{
Console.WriteLine("A verem üres");
return default;
}
return elemek[teteje];
}
public bool Ures()
{
return teteje == -1;
}
public void Kiir()
{
if (Ures())
{
Console.WriteLine("A verem üres");
return;
}
Console.WriteLine("A verem elemei csúcstól lefelé: ");
for(int i = teteje; i >= 0; i--)
{
Console.WriteLine(elemek[i]);
}
}
}
internal class Program
{
static void Main(string[] args)
{
Verem<int> verem = new Verem<int>(5);
verem.Push(10);
verem.Push(20);
verem.Push(30);
verem.Push(40);
verem.Kiir();
verem.Pop();
verem.Kiir();
}
}

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"ConsoleApp1/1.0.0": {
"runtime": {
"ConsoleApp1.dll": {}
}
}
}
},
"libraries": {
"ConsoleApp1/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

View File

@ -0,0 +1,68 @@
{
"format": 1,
"restore": {
"C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj": {}
},
"projects": {
"C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"projectName": "ConsoleApp1",
"projectPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"packagesPath": "C:\\Users\\szabomarton\\.nuget\\packages\\",
"outputPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\szabomarton\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.400/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\szabomarton\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\szabomarton\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]

View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ConsoleApp1")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d802eb4b674758609f9a4b91a0ce5576ed3a6cd3")]
[assembly: System.Reflection.AssemblyProductAttribute("ConsoleApp1")]
[assembly: System.Reflection.AssemblyTitleAttribute("ConsoleApp1")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -0,0 +1 @@
3c2e7ad382fcdee58d4ddf80631dbbf8a4f0c5a24f2423aefb326db303479fd0

View File

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = ConsoleApp1
build_property.ProjectDir = C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1 @@
7f1c35188bf0c59fbea1d24b1d43dc1963ee3d5043bdfb42e9b9890b98c38178

View File

@ -0,0 +1,14 @@
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\ConsoleApp1.deps.json
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\ConsoleApp1.runtimeconfig.json
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\ConsoleApp1.dll
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\ConsoleApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.AssemblyInfoInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.AssemblyInfo.cs
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.dll
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\refint\ConsoleApp1.dll
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ConsoleApp1.genruntimeconfig.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20241122\ConsoleApp1\ConsoleApp1\obj\Debug\net8.0\ref\ConsoleApp1.dll

View File

@ -0,0 +1 @@
0c04a0370fb6c5e06eab55176904758c649ab2afec3dfdabfda400adc65066cc

View File

@ -0,0 +1,73 @@
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\\Users\\szabomarton\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"projectName": "ConsoleApp1",
"projectPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"packagesPath": "C:\\Users\\szabomarton\\.nuget\\packages\\",
"outputPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\szabomarton\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.400/PortableRuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "hKvlne6ZWfY=",
"success": true,
"projectFilePath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20241122\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"expectedPackageFiles": [],
"logs": []
}

BIN
20241122/Órai1122.pdf Normal file

Binary file not shown.

View File

@ -187,3 +187,37 @@ Láncolt listák fontos metódusai
A .Value metódus az adott csomópontban eltárolt adatot adja vissza.
Mivel tudjuk, hogy a láncolt listák utolsó, illetve első eleme null értékű, így egy while ciklussal is végig tudunk menni az adott láncolt listán,
a léptetéséről a Next gondoskodik.
Verem (stack)
A verem egy olyan adatszerkezet, amelyben az utoljára betett elemet tudjuk feldolgozni.
(LIFO)
A veremmutató mindig a legfelső elemre mutat.
A push a tetejére rak , a pop onnan vesz el.
A Stack<T> osztály fontosabb tulajdonságai és metódusai:
Stack(int capacity)
Paraméteres konstruktor. A paraméter a kiindulásként tárolni kivánt elemej számát adja meg.
Stack(IEnumerable<T> collection)
Paraméteres konstruktor.
A verem elemei aparaméterklnt megadott IEnumerable felület implementáló osztály elemei lesznek.
T Peek()
Visszaadja a verem tetején lévő elemet anélkül, hogy azt kivenne a verembol.
T Pop()
Visszaadja a verem tetején lévő elemet és az elemet eltávolítja a veremből.
void Push()
A paraméterkéntmegadott elemet beilleszti a verem tetejére.
T[] ToArray()
A verem elemeit visszaadja egy tömbben.
void TrimExcess()
Átméretezi a veremet úgy, hogy csak annyi elemnek foglaljon helyet, mint amennyi ténylegesen használva van.