Skip to content

Instantly share code, notes, and snippets.

View prembhaskal's full-sized avatar

premkumar bhaskal prembhaskal

  • VMware
  • Bengaluru
View GitHub Profile
#@ load("@ytt:data", "data")
---
top: #@ data.values
@prembhaskal
prembhaskal / CountStream.java
Last active June 30, 2023 13:42
Java Stream questions.
package basics;
import java.util.Arrays;
public class CountStream {
public static void main(String[] args) {
System.out.printf("hello world\n");
int[] nums = new int[]{0, 1, 2, 3, 4, 2, 1, 4, 5, 1};
package parallel_test
import (
"sync"
"testing"
"github.com/prembhaskal/go_practice/learning/parallel"
)
func TestRaceTest2(t *testing.T) {
package parallel
import "sync"
type clientsync struct {
val int
}
func (c *clientsync) Add(x int) int {
return c.val + x
@prembhaskal
prembhaskal / reference_ptr_test.go
Created March 10, 2022 16:24
test code to check the synchronous access.
package parallel_test
import (
"sync"
"testing"
)
func TestRaceTest1(t *testing.T) {
l := parallel.NewLibrary()
@prembhaskal
prembhaskal / reference_ptr_v1.go
Last active March 10, 2022 16:37
testing reference pointer
package parallel
import "sync"
type client struct {
val int
}
func (c *client) Add(x int) int {
return c.val + x
@prembhaskal
prembhaskal / clrs_appendix_B.md
Last active November 23, 2020 14:40
CLRS appendix B notes solution

CLRS appendix B

TODO -- try creating github pages similar to site https://github.com/walkccc/CLRS from md file and katex math library.

section 5

exercise B.5-2

Let G = (V,E) be Directed acyclic graph in which vertex exits V0 such that there exists unique path from V0 to all vertex. Prove that undirected version of G forms a tree