In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Always feel that their data structure learning is not very good, take the time to practice the basic algorithm.
Let's take a picture first and learn about the algorithm.
Cdn2.b0.upaiyun.com/2012/01/Visual-and-intuitive-feel-of-7-common-sorting-algorithms.gif ">
Here is the code implementation of golang. Welcome to beat the brick.
The algorithm is relatively simple, that is, I have been thinking about it on the node out of the stack for a long time, which is welcome.
Package main
Import (
"fmt"
)
Const (
Greaterthan = iota / / greater than
Equal / equals
Lessthan / / less
)
/ / compare
Func comparedata (D1 int, D2 int) int {
If D1 < D2 {
Return lessthan
} else if D1 = = D2 {
Return equal
} else {
Return greaterthan
}
}
/ / Exchange
Func swap (D1 * int, D2 * int) {
Var temp int
Temp = * D1
* D1 = * D2
* D2 = temp
Return
}
/ / sort
Func quicksort (datalist [] int, left int, right int) {
Var middle int
Middle = (left + right) / 2
If middle = = left {
Return
}
If middle = = right {
Return
}
Fmt.Println ("left", left, "right", right)
For I: = left; I
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.