是不是因为java语法比较简单,容易实现,直接接触算法思想,而不会像使用c++那样有很多语法细节?
黄舟2017-04-18 09:57:25
It is recommended that students who are new to data structures use C directly. It is definitely not recommended to use Java. C allows you to further understand the implementation of the underlying code and algorithmic ideas. Java encapsulation is too deep, making it easy to ignore the underlying code (the underlying code is not easy to see). For algorithms, I recommend using C++ or Java. Algorithms focus on ideas and implementation, followed by language (without considering algorithm performance). If you can best use C, you will benefit immensely in the future.
伊谢尔伦2017-04-18 09:57:25
Algorithms have nothing to do with language. Just choose the algorithm you are best at
天蓬老师2017-04-18 09:57:25
As for algorithms, if you are a student in school, the teacher will usually ask you to use C to implement the algorithm. Many functions of Java have ready-made interfaces for calling. Sometimes it makes you ignore some of the underlying things.
PHP中文网2017-04-18 09:57:25
This is going to be a fight.
I have learned all three languages you mentioned, and C++ and Java are both good choices.
It’s okay to say more, Easy or not is subjective. You might as well try to buy three algorithm books written in C, C++, and Java languages, read them briefly, and continue learning if you like them.
阿神2017-04-18 09:57:25
In fact, if you want to learn data structure, I personally suggest you use C language! Because C language can bring you closer to the bottom layer, such as memory allocation
大家讲道理2017-04-18 09:57:25
It depends on what you plan to learn from the exercises. Algorithms are in many cases language independent, but if you want to understand the operations of very basic data types and data structures (such as why arrays and linked lists have irreplaceable uses in different fields) , then it is best to bypass the encapsulation that has already been performed on these basic structures. Java C++ has done a very good job of encapsulating collection types, and some C libraries have also done this, so more efforts should be made to bypass these already implemented APIs and use simple data types to cooperate with controls, loops, functions, etc. mechanism to implement it, rather than bypassing a certain language
黄舟2017-04-18 09:57:25
The important thing is the thought. It doesn’t matter which language. To learn Java, just read the java version. To learn c, just read the c version. To learn c++, just read the c++ version. It’s so confusing and takes so much time. It’s of no use at all
怪我咯2017-04-18 09:57:25
Use C to learn data structures, and C++/JAVA to learn algorithms.
Just started to learn data structures and algorithms, use C
大家讲道理2017-04-18 09:57:25
Algorithms have nothing to do with language. Algorithms are an idea and language is an implementation.