Tag: sort
-
[Go] How to deal with sort and heap (2)
1. Quick Recap In the previous post, we explored the concept of interfaces and how the sort package utilizes them. Understanding the abstract role that interfaces play, independent of specific implementations, was crucial. This abstraction allowed us to work with various types by tying them to the same interface, enabling them to be passed as…
-
[Go] How to deal with sort and heap (1)
1. Understanding Interface 1-a. What is an interface Before we take a look at sort and heap packages, we have to understand what Interface is and how it works. We use Interface to maintain flexible code. Instead of relying on concrete implementations, interfaces allow you to work with abstract method sets, enabling you to apply…