我应该先学习数据结构和算法还是先学习 Java 编程语言?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2793233/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 22:51:25  来源:igfitidea点击:

Should I learn about data structures and algorithms first or the programming language Java first?

javaalgorithmdata-structures

提问by Serenity

I am a beginner to programming. Should I learn data structures and algorithms, and the programming language Java side by side? Now that I know data structures and algorithms form the basis of programming. Should I learn them first?

我是编程的初学者。我应该同时学习数据结构和算法以及 Java 编程语言吗?现在我知道数据结构和算法构成了编程的基础。我应该先学习它们吗?

I am confused. What should be my learning path?

我很迷惑。我的学习路径应该是什么?

I want to be a really good Java programmer.

我想成为一名真正优秀的 Java 程序员。

回答by Jon Skeet

I think it's fine to learn the two side-by-side. If you try to just learn the data structures and algorithms first without doing any programming, it will all be a bit abstract - I think you're likely to learn more effectively if you can usewhat you're learning in a practical context. It also means you can experiment with what you're learning... it's harder to experiment in a theoretical way.

我觉得两个一起学挺好的。如果您尝试先学习数据结构和算法而不进行任何编程,那么这一切都会有点抽象 - 我认为如果您可以在实际环境中使用您所学的知识,您可能会更有效地学习。这也意味着你可以用你正在学习的东西进行实验......以理论方式进行实验更难。

回答by helpermethod

My recommendation:

我的建议:

1.) Learn the basics

1.) 学习基础知识

Learning the Java Language

学习 Java 语言

(excluding the Generics chapter, this is more of an advanced topic)

(不包括泛型章节,这更像是一个高级主题)

2.) While learning the basics, practice your gained knowledge by solving simple exercises

2.) 在学习基础知识的同时,通过解决简单的练习来练习你学到的知识

Coding Bat

编码蝙蝠

3.) Start implementing simple algorithms, learn how to use recursion

3.) 开始实现简单的算法,学习如何使用递归

  • Bubble Sort (only for practice, don't ever actually use this)
  • Insertion Sort
  • ...
  • 冒泡排序(仅供练习,切勿实际使用)
  • 插入排序
  • ...

4.) Grab a good book about Data Structures and Algorithms and start learning them

4.) 拿一本关于数据结构和算法的好书并开始学习它们

回答by bennybdbc

I think that you should learn only the very basics of java, then begin to learn about data structures and algorithms side by side with some more advanced java. If you start looking into things like algorithms without learning at least some language constructs, things are going to be hard to grasp.

我认为你应该只学习 Java 的基础知识,然后开始学习数据结构和算法以及一些更高级的 Java。如果你在没有学习至少一些语言结构的情况下开始研究算法之类的东西,事情将很难掌握。

回答by pbernatchez

Often we programmers never learn to be good programmers.

通常,我们程序员永远不会学会成为一名优秀的程序员。

The language we jump into first has too much influence on how we think about problems. Later, we may learn other languages but we continue to write programs as though we were using the first.

我们首先使用的语言对我们思考问题的方式影响太大。后来,我们可能会学习其他语言,但我们会继续编写程序,就像使用第一种语言一样。

Our horizons are clipped by that start language (e.g. Java) or paradigm (e.g. object oriented).

我们的视野被那个起始语言(例如 Java)或范式(例如面向对象)截断了。

Although we sense we are lacking something, we are too busy fighting alligators to drain the swamp that bogs us down.

尽管我们感觉自己缺少了一些东西,但我们忙于与鳄鱼搏斗,无法排干使我们陷入困境的沼泽。

My advice is don't jump into Java, or anything else too quickly. Expose yourself to a progression of languages right from the start. You'll end up a better Java programmer.

我的建议是不要太快进入 Java 或其他任何东西。从一开始就让自己接触语言的发展。你最终会成为一个更好的 Java 程序员。

This is a really good path to follow:

这是一个非常好的路径:

http://www.teach-scheme.org/Overview/

http://www.teach-scheme.org/Overview/

回答by Dominic Charley-Roy

I would personally reccomend you learn Java, although most programming languages will do. Although Algorithms and Data Structures are an important part of programming, they are not the only one. It is useful to be familiar with a programming language when studying any subsection of the software engineering realm, such as A.I. or Data Structures, as it gives you a deeper understanding of the inner workings of the algorithms. It is important to be able to read pseudocode and translate it into actual working code.

我个人建议您学习 Java,尽管大多数编程语言都可以。尽管算法和数据结构是编程的重要组成部分,但它们并不是唯一的。在学习软件工程领域的任何子部分(例如 AI 或数据结构)时,熟悉编程语言非常有用,因为它可以让您更深入地了解算法的内部工作原理。能够读取伪代码并将其转换为实际工作代码非常重要。

The Sun Tutorialsare great as they cover a large amount of material, both beginner (see the Language Basics section) and advanced.

太阳教程是伟大的,因为它们涵盖了大量的材料,无论是初学者(见的语言基础知识部分)和高级。

This free online Java Textbookis great as it can be viewed online, or offline by downloading a free PDF version.

这本免费的在线 Java 教科书很棒,因为它可以在线查看,也可以通过下载免费的 PDF 版本离线查看。

I would then recommend some practice to fully grasp the language, either by working on some small personal projects (simple text games, utilities, etc.) or by studying some open source code. Sourceforgeis great for this.

然后我会推荐一些练习来完全掌握这门语言,或者通过一些小的个人项目(简单的文本游戏、实用程序等)或者通过学习一些开源代码。Sourceforge非常适合这一点。

Also, if you enjoy mathematics, Project Euleris an excellent way of learning Java (or any other language as the challengs can be solved in any language). This will also help you develop the skills necessary to work with algorithms and solve them.

此外,如果您喜欢数学,Project Euler是学习 Java(或任何其他语言,因为挑战可以用任何语言解决)的绝佳方式。这也将帮助您培养使用算法并解决它们所需的技能。

Once you feel you have a good grasp of your language of choice, moving on to Algorithms and Data Structures will not only be easier but more enjoyable. Your ability to translate pseudo-code into working code will come in very useful as you can truly understand the workings of the algorithms and data structures and can implement them in test applications.

一旦你觉得你已经很好地掌握了你选择的语言,继续学习算法和数据结构不仅会更容易而且更有趣。您将伪代码转换为工作代码的能力将非常有用,因为您可以真正理解算法和数据结构的工作原理,并且可以在测试应用程序中实现它们。

回答by WineSoaked

Most data structures books are going to be rooted in some programming language. I would suggest finding one that uses Java and go from there. That being said, DS and algorithms are great, but those alone won't make you a 'really good Java programmer'.

大多数数据结构书籍都植根于某种编程语言。我建议找一个使用 Java 的,然后从那里开始。话虽如此,DS 和算法都很棒,但仅靠这些并不能使您成为“真正优秀的 Java 程序员”。

Here'sa link to a Google Shopping search for Java data structures books. I'll date myself by saying that I've never read any of them, and the DS book I read in college was written for C.

这是在 Google 购物中搜索 Java 数据结构书籍的链接。我会说我从未读过其中任何一本来与自己约会,而我在大学读过的 DS 书是为 C 编写的。

You should also have a look at the Pragmatic Bookshelf (Google it, I can't paste multiple links with my low rep) as well, they have books about the craftof programming, rather than just languages. Very handy indeed.

你也应该看看 Pragmatic Bookshelf(谷歌它,我不能用我的低代表粘贴多个链接),他们有关于编程工艺的书籍,而不仅仅是语言。确实很方便。

回答by Milena

Definitely my recommendation is to learn algorithms first and data structures after....and then a programming language like Java. I talk by my experience.

当然,我的建议是先学习算法,然后学习数据结构......然后是像 Java 这样的编程语言。我用我的经验说话。