Should I memories STL functions syntax before leaning STL?
I've not learnt STL yet, Currently in OOPs ,My question is, Since many times I've to come through the situation when I've to perform various functions like sorting array, finding HCF etc. I can achieve them without using any pre defined function,But apparently using them would be much efficient and better, Should i memories the syntax (Like sorting array etc) of various functions of STL before leaning STL?
5/14/2022 3:41:29 PMManav Roy
9 AnswersNew Answer
Learn syntax of only those containers and functions which are coming in use. If you want to be good in it then try many problems of different topics and level, with practice you will notice that there is no need to know all of it only few will be enough. CodeForces is one of the best site to learn it faster.
I dont code in c++ so idk but it also should have well implemented structures like hash maps, lists, sets and so on. So use them, it is nonsense to write own classes which will do the same.
your question is kind of wordy so hopefully I understood. I do recommend you learn how to write your own implementations, it'll help you understand what you're using (from STL) and how to customize your own so you don't have to rely on the STL. "STL map doesn't do what I want" Either you're screwed or since you know how to implement a map, make your own to fit your needs! Not necessary, but I also recommend looking in the source code of things to see how they work and finding efficient implementations. Not always possible but great for c++ programmers.
「ＨＡＰＰＹ ＴＯ ＨＥＬＰ」 Actually, I know how to find HCF,sort array in c++ without any pre defined function, But i would like to use pre defined functions in these types of basic things as this would saves alot time and much efficient. I want to know should i memories then right now or after leaning STL?
What are you asking exaclty ? By memorzing stl function syntax wouldnt that also be learning stl ?
Ah that makes more sense Id say it depends on your goal If the goal is for example learning algorithms Or data structures Then implement it yourself If the goal is something else but to reach it you first need to use an algorithm or some data structure save yourself time and use the STL For example <vector> is part of the STL and more than likely you already use without thinking about implementing it yourslef
Raul Ramirez I mean that i am currently into OOPs. I've not touched STL topic yet ,But during practicing problems , I've to come through the situation where I've to sort an array,find hcf etc. My question is , Should i do them by STL pre defined functions or without any pre defined functions.
Raul Ramirez Actually,I would have to learn STL soon after I done with OPPs. So i thinking of initially memorising the STL functions for solving problems.