In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.