Skip to content

Instantly share code, notes, and snippets.

View P-A-R-U-S's full-sized avatar
💭
Building a dream...

Valentyn Ponomarenko P-A-R-U-S

💭
Building a dream...
View GitHub Profile
@P-A-R-U-S
P-A-R-U-S / PDBtoGAC.ps1
Created April 5, 2016 19:09
.NET: Copy PBD file to GAC ( Powershell script that copy all you PDB field to GAC)
#ODB Files Location
$binFolder = "C:\Projects\.net 2.0\build\bin"
$gacFolder = "%SYSTEMROOT%\Assembly\GAC_MSIL"
set-location $binFolder
$pdbfiles = get-childitem | where {$_.name.EndsWith("pdb")}
foreach ($pdb in $pdbfiles)
{
@P-A-R-U-S
P-A-R-U-S / Queue - Golang.go
Last active October 20, 2019 07:02
Queue in Go/Golang
package Helpers
type Queue struct {
q []int32
}
func (q *Queue) push(v int32) {
q.q = append(q.q, v)
}
@P-A-R-U-S
P-A-R-U-S / Sort Byte Array - Golang.go
Last active October 20, 2019 07:02
Sort Byte ([]byte) array in Go/Golang
b := []byte("9856743210")
fmt.Println("Before:", string(b))
sort.Slice(b, func(i, j int) bool {
return b[i] < b[j]
})
fmt.Println("After:", string(b))
@P-A-R-U-S
P-A-R-U-S / Stack - Golang.go
Last active October 20, 2019 07:02
Stack implementation in Golang
// Following implemetation of Stack tie each element to it parent
type stackElement struct {
data interface{}
next *stackElement
}
type Stack struct {
Size int32
head *stackElement
package DataStuctures
import (
"testing"
)
type MinHeap struct {
heap []int32
}
package DataStuctures
import (
"testing"
)
type MaxHeap struct {
heap []int
}
@P-A-R-U-S
P-A-R-U-S / Find_max_number_of_connected_colors_in_grid.go
Last active December 27, 2019 18:11
Find max number of connected colors in grid
package Google
import "testing"
// Find max number of connected colors in grid
// https://proglib.io/p/google-interview-task/?fbclid=IwAR2PXn_XqXQx97U3FLSFssVfDa1-m2P-T3yAJELEJoOWpNfcQjfyesOegpY
type si struct {
r int
c int
@P-A-R-U-S
P-A-R-U-S / Cracking_the_Coding_Interview_4-8_test.go
Last active May 31, 2020 21:46
Cracking the Coding Interview - Task - 4.8
/*
First Common Ancestor: Design an algorithm and write code to find the first common ancestor of two nodes in a binary tree.
Avoid storing additional nodes in a data structure.
NOTE: This is not necessarily a binary search tree.
Hints: # 10, #16, #28, #36, #46, #70, #80, #96
*/
/*
Создайте алгоритм и напишите код поиска первого общего предка двух узлов бинарного дерева. Постарайтесь избежать
хранения дополнительных узлов в структуре данных.
@P-A-R-U-S
P-A-R-U-S / Cracking_the_Coding_Interview_4-9_test.go
Last active June 1, 2020 02:30
Cracking the Coding Interview - Task - 4.9
package Part_4
import (
"fmt"
"testing"
)
/*
BST Sequences: A binary search tree was created by traversing through an array from left to right and inserting each element.
Given a binary search tree with distinct elements, print all possible arrays that could have led to this tree.
@P-A-R-U-S
P-A-R-U-S / Cracking_the_Coding_Interview_4-12_test.go
Last active June 15, 2020 03:55
Cracking the Coding Interview - Task - 4.12 - Find path equal K in binary tree
package Part_4
import (
"testing"
)
/*
Paths with Sum: You are given a binary tree in which each node contains an integer value (which might be positive or negative).
Design an algorithm to count the number of paths that sum to a given value.