Skip to content

Instantly share code, notes, and snippets.

View YonLiud's full-sized avatar

Yonatan Mark Liudmirsky YonLiud

View GitHub Profile
#!/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 February 21, 2021 14:59
batch code to sync time on your computer
net start W32Time
w32tm /resync
@YonLiud
YonLiud / Merge-sort-Input.cs
Created January 9, 2021 10:38
Sort Node<T> LinkedList, Merge Sort
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 February 21, 2021 14:59
Node<T> Class made for highschool & education
/* 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 December 28, 2020 12:42
Selection Array Sorting Method - C#
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 December 28, 2020 12:40
Bubble Array Sorting Method - C#
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 December 28, 2020 12:42
Injection Array Sorting Method - C#
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