-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
70 lines (65 loc) · 1.95 KB
/
main.go
File metadata and controls
70 lines (65 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package main
import (
"algorithm-datastructure/topics"
"fmt"
)
func main() {
// arr := []int{234, 456, 29, 1, 122, 995}
// test sameFreuqncy algo
// result := problems.IsSame([]int{1, 2, 3}, []int{1, 4, 9})
// result := problems.ValidAnagram("", "")
// result := problems.SumZero([]int{-4, -3, -2, -1, 0, 1, 2, 5})
// result := problems.CountUniqueValues([]int{1, 2, 3, 4, 4, 4, 7, 7, 12, 12, 13})
// result := topics.BubbleSort([]int{32, 23, 12, 77, 8})
// result := topics.BetterBubbleSort([]int{32, 23, 12, 77, 8})
// result := topics.SelectionSort([]int{32, 23, 12, 77, 8})
// result := topics.InsertionSort([]int{32, 3323, 312, 7, 8})
// result := topics.MergeSort([]int{23, 34, 11, 10, 245, 2})
// topics.QuickSort(arr, 0, len(arr)-1)
// result := topics.RadixSort(arr)
// list := topics.NewLinkedList()
// list.Push("Hello")
// list.Reverse()
// stack := topics.NewStack()
// stack.Push(1)
// result := stack.Pop()
// fmt.Println(result, "this is poped value")
// queue := topics.NewQueue()
// queue.Enqueue(1)
// queue.Enqueue(2)
// queue.Enqueue(3)
// queue.Print()
// result := queue.Dequeue()
// queue.Print()
// tree := topics.NewBst()
// tree.Insert(10)
// tree.Insert(6)
// tree.Insert(15)
// tree.Insert(3)
// tree.Insert(8)
// tree.Insert(20)
// result := tree.DFSInOrder()
// fmt.Println(result)
// heap := topics.NewHeaps()
// heap.Insert(55)
// heap.Insert(39)
// heap.Insert(41)
// heap.Insert(18)
// heap.Insert(27)
// heap.Insert(12)
// heap.Insert(33)
// heap.Print()
// heap.ExtractMax()
priorityqueue := topics.NewPriorityQueue()
priorityqueue.Enqueue("sarma khordegi", 5)
priorityqueue.Enqueue("tir khorde", 1)
priorityqueue.Enqueue("shekastegi dast", 4)
priorityqueue.Enqueue("bihoshi", 2)
priorityqueue.Enqueue("tes asdasd", 3)
result := priorityqueue.Dequeue()
fmt.Println(result)
result = priorityqueue.Dequeue()
fmt.Println(result)
result = priorityqueue.Dequeue()
fmt.Println(result)
}