Skip to content

Commit

Permalink
Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatgupta310198 committed Sep 14, 2020
2 parents 5656851 + eaffc51 commit 8d9adf1
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package main


// import formatted I/O package
import (
"algos/src/Algo/other/permutaions"
"algos/src/Algo/search/graph"
"fmt"
)


// We define a function add which takes 2 int variables as function parameters
// Returns addition of the parameters with type int
func add(a int, b int) int {
Expand All @@ -20,10 +18,9 @@ func compareA(a float64, b float64) bool {
return a > b
}


// Any program in go start with main function inside "main' package
// You can put main inside any other folders like src/main/graph_test.go
func main() {
// You can put main inside any other folders like src/main/main.go
func main() {
fmt.Printf("Hello World!\n")

// Notice type of variable declarations
Expand All @@ -32,13 +29,13 @@ func main() {
// After declaring 2 is assigned
a = 2
// We declare and assigned variable 'b' with value 4
var b = 4
var b = 4

// This is another way of defining variable where we put := for assigning data to variable in LHS
// c is not declared we just assigned it with 4.2 which explicitly makes it a variable of float type with value 4.2
c:=4.2
c := 4.2

d:=2.42
d := 2.42

// C style I/o printing with %d representing placeholder for in variables specifically of type int
fmt.Printf("Addition of %d and %d is = %d\n", a, b, add(a, b))
Expand All @@ -51,16 +48,13 @@ func main() {
// %v is placeholder for bool
fmt.Printf("Is %.2f is grater thant %.2f ? \nAnswer is %v\n", c, d, compareA(c, d))



// importing permutations package created under src/Algo/other
fmt.Println(permutaions.FactorialRecursive(10))

stringVar := "abcd"
permutationStrings := permutaions.HeapsPermutation(4, stringVar)
fmt.Println(permutationStrings)


G := graph.NewGraph()

v0 := G.AddVertex("A")
Expand All @@ -75,4 +69,6 @@ func main() {
G.AddEdge(v3, v3)
G.PrintGraph()
G.Dfs(v2)
fmt.Println("Sridha Saha")
fmt.Println("on branch sridha for adding career TV")
}

0 comments on commit 8d9adf1

Please sign in to comment.