python - 学习数据结构和算法是否用java实现比c++和c好?
PHPz
PHPz 2017-04-18 09:55:25
0
14
1374

是不是因为java语法比较简单,容易实现,直接接触算法思想,而不会像使用c++那样有很多语法细节?

PHPz
PHPz

学习是最好的投资!

reply all(14)
黄舟

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.

伊谢尔伦

Algorithms have nothing to do with language. Just choose the algorithm you are best at

Peter_Zhu

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.

Ty80

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.

阿神

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

大家讲道理

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

迷茫

There is no doubt that c++ is your best choice.

黄舟

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

刘奇

Use C to learn data structures, and C++/JAVA to learn algorithms.
Just started to learn data structures and algorithms, use C

大家讲道理

Algorithms have nothing to do with language. Algorithms are an idea and language is an implementation.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template