Skip to content

Instantly share code, notes, and snippets.

View shyamvlmna's full-sized avatar
🎯

Shyamjith Palakkandy shyamvlmna

🎯
View GitHub Profile
@shyamvlmna
shyamvlmna / sorting.go
Last active March 1, 2023 12:08
Sorting algorithms in Go (Selection sort, Insertion sort, Bubble sort, Merge sort, Quick sort)
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
package main
import (
"fmt"
"sync"
)
var wg sync.WaitGroup
func main() {
@shyamvlmna
shyamvlmna / grayscale.go
Last active September 7, 2022 07:28
A simple way of grayscaling an image using standard libraries in golang
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"os"
)
@shyamvlmna
shyamvlmna / BREADTH FIRST SEARCH IN A GRAPH
Last active September 4, 2022 12:34
ALGORITHM FOR BREADTH FIRST SEARCH IN A GRAPH
ALGORITHM FOR BREADTH FIRST SEARCH IN A GRAPH
have a hashmap to add visited nodes
have a queue to keep visited nodes
start from the root node
add root to visited
push root to queue
for queue is not empty
@shyamvlmna
shyamvlmna / user.go
Created August 14, 2022 21:45
definition and methods for a user model using golang and postgresql with validation
package models
import (
"errors"
"html"
"log"
"strings"
"time"
validator "github.com/asaskevich/govalidator"