search

Home  >  Q&A  >  body text

python - 学习数据结构和算法是否用java实现比c++和c好?

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

PHPzPHPz2807 days ago1386

reply all(14)I'll reply

  • 黄舟

    黄舟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.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 09:57:25

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

    reply
    0
  • 天蓬老师

    天蓬老师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.

    reply
    0
  • PHP中文网

    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.

    reply
    0
  • 阿神

    阿神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

    reply
    0
  • 大家讲道理

    大家讲道理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

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:57:25

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

    reply
    0
  • 黄舟

    黄舟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

    reply
    0
  • 怪我咯

    怪我咯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

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 09:57:25

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

    reply
    0
  • Cancelreply