53 lines
848 B
Go
53 lines
848 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"os"
|
|
ds "source/pkg/data_struct"
|
|
|
|
// rs "source/pkg/resulter"
|
|
ll "source/pkg/structures/linked_list"
|
|
)
|
|
|
|
func isInArr(arr []int, length int, target int) bool {
|
|
for i := 0; i < length; i++ {
|
|
if arr[i] == target {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func Razdelitel() {
|
|
for i := 0; i < 20; i++ {
|
|
fmt.Print("-")
|
|
}
|
|
fmt.Println()
|
|
}
|
|
|
|
func pressEnterToContinue() {
|
|
fmt.Print("Нажмите Enter для продолжения...")
|
|
bufio.NewReader(os.Stdin).ReadBytes('\n')
|
|
}
|
|
|
|
func main() {
|
|
fmt.Println("hello world!")
|
|
|
|
head := ll.NewLinkedList()
|
|
|
|
for i := 1; i <= 20; i++ {
|
|
name := fmt.Sprintf("User_%02d", i)
|
|
phone := fmt.Sprintf("Phone_%02d", i)
|
|
head.Insert(*ds.NewData(name, phone))
|
|
}
|
|
|
|
head.PrintAll()
|
|
|
|
head.Delete("User_05")
|
|
|
|
head.PrintAll()
|
|
|
|
fmt.Println(head.Search("User_07"))
|
|
}
|