Skip to content

Instantly share code, notes, and snippets.

View fotonmoton's full-sized avatar

Gregory fotonmoton

  • Ukraine
View GitHub Profile
using System;
namespace lab1
{
class Program
{
public static double power(double x, double n)
{
if (n == 0)
{
@fotonmoton
fotonmoton / cos.cs
Created February 15, 2016 19:08
cos recursion
using System;
namespace cos_recursion
{
class Program
{
public static double power(double x, double n)
{
if (n == 0)
{
@fotonmoton
fotonmoton / abs.cs
Last active February 17, 2016 19:43
abs for all random negative elements in array that equals to maximum value of array
/*
Find all absolute values of max value of array.
*/
using System;
using System.Collections.Generic;
namespace lab2
{
class Program
@fotonmoton
fotonmoton / fcfs_linux.c
Last active February 19, 2016 17:33
first come first serve algorithm (Linux)
// Compile with: gcc fcfs_linux.c -lncurses -o lol
// if you doesn't have ncurses lib type in terminal: sudo apt-get install libncurses5-dev
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
#include <stdlib.h>
#include <ncurses.h>
int main()
{
@fotonmoton
fotonmoton / fcfs_win.c
Last active February 19, 2016 17:32
first come first serve algorithm (Win)
// Run VS dev terminal: start button -> serch "dev" -> start VS developer terminal
// Compile with: cl fcfs_win.c
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
#include<conio.h>
#include<windows.h>
int main()
{
@fotonmoton
fotonmoton / sjf_win.c
Last active February 19, 2016 17:45
shortest job first scheduling algorithm (Win)
// Run VS dev terminal: start button -> serch "dev" -> start VS developer terminal
// Compile with: cl sjf_win.c
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
#include<conio.h>
#include<windows.h>
int main()
{
@fotonmoton
fotonmoton / sjf_linux.c
Last active September 7, 2022 23:12
shortest job first scheduling algorithm (Linux)
// Compile with: gcc sjf_linux.c -lncurses -o lol
// if you doesn't have ncurses lib type in terminal: sudo apt-get install libncurses5-dev
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
#include<stdlib.h>
#include<ncurses.h>
int main()
@fotonmoton
fotonmoton / rr_win.c
Last active February 19, 2016 17:45
round robin scheduling algorithm (Win)
// Run VS dev terminal: start button -> serch "dev" -> start VS developer terminal
// Compile with: cl rr_win.c
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
#include<windows.h>
int main()
{
@fotonmoton
fotonmoton / rr_linux.c
Last active February 19, 2016 17:44
round robin scheduling algorithm (Linux)
// Run VS dev terminal: start button -> serch "dev" -> start VS developer terminal
// Compile with: cl rr_win.c
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
#include<stdlib.h>
#include<ncurses.h>
int main()
@fotonmoton
fotonmoton / priority_win.c
Last active February 19, 2016 17:46
priority CPU scheduling algorithm (Win)
// Run VS dev terminal: start button -> serch "dev" -> start VS developer terminal
// Compile with: cl priority_win.c
// http://www.ssau.ru/files/education/metod_1/%D0%9A%D1%83%D0%BF%D1%80%D0%B8%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%90.%D0%92.%20%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B%20%D0%BF%D0%BB%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.pdf
#include<stdio.h>
int main()
{
int p[20],bt[20],pri[20], wt[20],tat[20],i, k, n, temp;
float wtavg, tatavg;