Skip to content

Instantly share code, notes, and snippets.

View GlulkAlex's full-sized avatar
🏠
Working from home

Alex Glukhovtsev GlulkAlex

🏠
Working from home
View GitHub Profile
@GlulkAlex
GlulkAlex / zeroest_Temperature.scala
Last active May 5, 2016 09:36
Functional Programming: Recursion, Scala
import math._
import scala.util._
/**
* Created by Alex on 20.06.15.
*/
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
@GlulkAlex
GlulkAlex / string_Compression.scala
Last active May 5, 2016 12:58
Functional Programming: Recursion, Divide and Conquer, String Parsing, Scala
object Solution {
def main(args: Array[String]) {
/* Enter your code here.
Read input from STDIN.
Print output to STDOUT.
Your class should be named Solution
*/
///>>> it seems that something faster than O(N) needed
///> QuickSortMerge may be ? O(N * log(N)) ???
@GlulkAlex
GlulkAlex / Least_common_multiple.ipynb
Last active June 3, 2016 17:41
Least_common_multiple
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GlulkAlex
GlulkAlex / SumOfDivisors.py
Created June 7, 2016 14:03
Sum_Of_Divisors
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = int(input())
# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr)
@GlulkAlex
GlulkAlex / odd_XOR_Filter.py
Created June 9, 2016 15:37
filter sequence of odd integer elements using bitwise exclusive or
def lonely_Integer(
b: list# of int
) -> int:
so_Far = set()
answer = 0
for n in b:
if n in so_Far:
so_Far.discard(n)
else:
@GlulkAlex
GlulkAlex / Capitalize.py
Created June 26, 2016 08:15
string Capitalization
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#utf_8 U8, UTF, utf8
"""Capitalize.py:
interactive Python sessions for doctest
must be in the `right` place
in order to be executed
@GlulkAlex
GlulkAlex / hackerRank_IO_handler.scala
Created July 10, 2016 05:58
handles IO operations for hackerRank challenges in Scala
object Solution extends App{
import scala.annotation.tailrec
import scala.io.StdIn
import scala.util.{Try, Success, Failure}
import scala.math.pow//{abs, pow, ceil, floor}
// as replacement of this Java styled code
/*
@GlulkAlex
GlulkAlex / binary_Tree__Build_N_Print.scala
Created February 3, 2017 14:12
binary tree creation|building|deserialization|unmarshalling, traversal, representation, serialization|marshalling
#!/usr/bin/env scala
// for The `bash` `shell script` './script.sh'
//
//import scala.math.{log, ceil}
import io.AnsiColor._
// or
//import Console.{GREEN, RED, RESET, YELLOW_B, UNDERLINED}
//
//
// ? Is something wrong with:
@GlulkAlex
GlulkAlex / balanced_Binary_Search_Tree.js
Created March 3, 2017 13:33
An AVL tree (Georgy Adelson-Velsky and Landis' self-balancing binary search tree, named after the inventors)
"use strict";
//
var binary_Search_Tree_Name_Space = {};
//
// Done: implement `get_UnBalanced_Sub_Tree`
// recursive, but not @tail recursive | stack safe
// traversal from top to bottom
/** it must return:
- [unBalanced_Sub_Tree object, balance_Factor] if any
- or [null, 0] if not found|search fails
@GlulkAlex
GlulkAlex / digital_Circuit_Logic_Gates.scala
Created March 4, 2017 12:17
Exercise from Discrete Event Simulation Lecture of Functional Program Design In Scala course
#!/usr/bin/env scala
// for The `bash` `shell script` './script.sh'
// but App main object warper must be disabled|excluded
import scala.io.AnsiColor._
// it is imported twice in the same scope by
//import scala.Console._
//
//
/*object digital_Circuit_Logic_Gates extends App */{
/* A digital circuit is composed