Skip to content

Instantly share code, notes, and snippets.

Avatar

Yonatan Mark Liudmirsky YonLiud

View GitHub Profile
View .bashrc
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@YonLiud
YonLiud / timesync.cmd
Created Feb 21, 2021
batch code to sync time on your computer
View timesync.cmd
net start W32Time
w32tm /resync
@YonLiud
YonLiud / Merge-sort-Input.cs
Created Jan 9, 2021
Sort Node<T> LinkedList, Merge Sort
View Merge-sort-Input.cs
static Node<int> SortInput()
{
Console.WriteLine("Insert Value | Insert '-999' to stop");
int value = int.Parse(Console.ReadLine());
Node<int> node = new Node<int>(value);
while (value != -999)
{
node.SetNext(new Node<int>(value));
Console.WriteLine("Insert Value | Insert '-999' to stop");
value = int.Parse(Console.ReadLine());
@YonLiud
YonLiud / Node.cs
Last active Feb 21, 2021
Node<T> Class made for highschool & education
View Node.cs
/* The class Node<T> **/
public class Node<T>
{
private T value; // Node value
private Node<T> next; // next Node
/* Constructor - returns a Node with "value" as value and without successesor Node **/
public Node(T value)
{
this.value = value;
@YonLiud
YonLiud / selection.cs
Last active Dec 28, 2020
Selection Array Sorting Method - C#
View selection.cs
static int[] SelectionSort(int[] inputArray)
{
int[] outputArray = inputArray;
int temp, smallest;
for (int i = 0; i < ARRAY_SIZE; i++)
{
smallest = i;
for (int j = i + 1; j < ARRAY_SIZE; j++)
{
if (outputArray[j] < outputArray[smallest])
@YonLiud
YonLiud / bubble.cs
Last active Dec 28, 2020
Bubble Array Sorting Method - C#
View bubble.cs
static int[] BubbleSort(int[] inputArray)
{
bool swapped;
int[] outputArray = inputArray;
for (int i = 0; i < ARRAY_SIZE; i++)
{
swapped = false;
for (int j = 0; j < ARRAY_SIZE - 1; j++)
{
@YonLiud
YonLiud / injection.cs
Last active Dec 28, 2020
Injection Array Sorting Method - C#
View injection.cs
static int[] InsertionSort(int[] inputArray)
{
int[] outputArray = inputArray;
int tmp;
bool swapped;
int count = 0;
for (int i = 0; i < ARRAY_SIZE - 1; i++) // checking all numbers
{
swapped = false;
for (int j = i + 1; j > 0; j--) // initializing the next number