算法和数据结构:我应该学习特定语言的书籍还是通用书籍?

发布于 2024-12-13 05:17:29 字数 737 浏览 0 评论 0原文

我想详细研究算法和数据结构(为了成为一名更好的程序员:P),我已经编程了 2-3 年(c++、java、python),

在 google 上搜索让我困惑于两种类型的书籍/ ?

我应该去寻找特定于语言的书籍吗 http://www.amazon.com/Data-Structures-Algorithms-Using-Python/dp/0470618299/ref=sr_1_2?ie=UTF8&qid=1320183104&sr=8-2

或类似普通书 http://www.amazon.com/Data-Structures-Algorithms-Alfred-Aho/ dp/0201000237

这些只是示例,主要问题是我应该选择什么类型的资源,特定语言的资源还是通用的资源?无论如何会有什么不同吗?

另外,建议一本好的网络资源/书籍(免费更好),我可以在其中积累大量有关算法和数据结构的详细知识。数学不是问题

注意:我知道有很多类似的问题,但我怀疑的是,你对算法和数据结构的学习是否取决于你使用的编程语言?

谢谢, 肖比特,

I wanted to study algorithms and data structures in detail (in the quest of becoming a better programmer :P ), i have been programming for 2-3 years (c++, java, python)

searching on google confused me between two type of books/web-resources

should i go for the books that are language specific like
http://www.amazon.com/Data-Structures-Algorithms-Using-Python/dp/0470618299/ref=sr_1_2?ie=UTF8&qid=1320183104&sr=8-2

or a generic book like
http://www.amazon.com/Data-Structures-Algorithms-Alfred-Aho/dp/0201000237

these are just examples, the main question is what type of resource should i choose, something language specific or generic? would there be a difference in anyway?

also, suggest a good web-resource/book (free is better) where i can accumulate good amount of knowledge in detail regarding algorithms and data structures. math is no issue

Note: i know there are many similar questions but my doubt is, would your study of algorithms and data structures depend on what programming language you use?

thanks,
Shobhit,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

半世蒼涼 2024-12-20 05:17:29

以特定于语言的方式学习算法和数据结构有优点和缺点。从好的方面来说,示例、练习和解释都非常具体。如果您有权访问该语言的执行环境,您就可以在学习这些概念时自行尝试这些概念。这是非常强大的。

不利的一面是,很难区分核心概念(例如,树中的节点和链接)和实现它们的特定于语言的方法(例如,C 中的结构和指针)。其他语言可能非常不同(例如,Prolog),如果您还没有学会如何将核心概念与您所学内容的特定于语言的方面分开,那么它们可能完全无法识别。还有一个问题是,通常有很多特定于语言的东西完全分散了核心概念的注意力。 (C 中的 malloc/free;C++ 中的构造函数和析构函数等,除非您正在研究内存管理算法。)

获得特定于语言的演示的好处并解决其缺点的一种方法是研究相同的语言为两种截然不同的语言提供的材料。整个类 Algol 语言系列(C、C++、Pascal、Algol、Java、C# 等)对于此目的基本上是等效的。我之前提到过Prolog;你也可以考虑 Lisp。另一个有趣的方法可能是像 SQL 这样的 4GL 语言。如果您可以在 C 程序以及 SQL 模式和查询集中实现良好的平衡树,那么您可以确信您已经掌握了平衡树涉及的基本概念。

There are pluses and minuses to learning about algorithms and data structures in a language-specific way. On the plus side, the examples, exercises, and explanations can be very concrete. Provided you have access to an execution environment for that language, you can experiment on your own with the concepts as you are learning them. This is very powerful.

On the minus side, it is harder to distinguish between the core concepts (e.g., nodes and links in a tree) and the language-specific methods for implementing them (e.g., structs and pointers in C). Other languages may be so different (e.g., Prolog), that the core concepts may be totally unrecognizable if you haven't learned how to separate them from the language-specific aspects of what you have learned. There's also the problem that there are usually lots of language-specific stuff that are entirely a distraction from the core concepts. (malloc/free in C; constructors and destructors in C++, etc., -- unless you're studying memory management algorithms.)

One way to have the benefits of a language-specific presentation and also address its shortcomings is to study the same material presented for two radically different languages. The entire family of Algol-like languages (C, C++, Pascal, Algol, Java, C#, etc.) are basically equivalent for this purpose. I mentioned Prolog before; you might also consider Lisp. Another interesting approach might be a 4GL language like SQL. If you can implement a good balanced tree in a C program and also in an SQL schema and set of queries, then you can be confident that you have mastered the underlying concepts involved in balanced trees.

琴流音 2024-12-20 05:17:29

您应该先获取 CLRS 。与语言无关。就算法而言,语言没有太大区别。这是理论/概念以及算法的工作原理。这就是你需要学习的。

一旦学习了这个概念,您就可以用您选择的任何语言编写算法。

这是由于复杂性。语言并不影响算法和复杂性,而影响实际算法。

回应 @birree,Skienna 的书,如果你问我的话,准备考试很好。我觉得有很多谜题。还有 Kleinberg计算机算法。 CLRS 就是圣经。

You should get CLRS to start with. Language agnostic. In terms of algorithms, language doesnt make much difference. It s the theory/concept and how the algorithm works. that s what you need to learn.

Once you learn the concept, you can write the algorithm in any language of your choice.

This is due to the Complexity. Languages doesnt make a difference in terms of algorithms and complexity but the actual algorithm.

In respond to @birryree, Skienna's book, if you ask me is great to prepare for exams. I felt like there were just lot of puzzles. There is also Kleinberg, and computer algorithms. CLRS is the bible.

ヅ她的身影、若隐若现 2024-12-20 05:17:29

我建议阅读两种类型的书籍。通用书籍基本上会指导您了解该主题的原因,而特定于编程语言的书籍通常会告诉您该主题的方法。所以我建议两者都使用,因为它们都有自己的意义。

I would recommend reading both types of books. Generic books will basically guide you on the WHYs of the topic and Programming language specific usually tells you HOWs of the topic. So I recommend use both as they have their own significance.

黯然#的苍凉 2024-12-20 05:17:29

大多数算法和数据结构书籍都非常独立于语言。有些使用伪代码,有些甚至没有那么多代码和 我最喜欢的书使用了 Pascal,尤其是。

Most Algorithms and Datastructures book are very language-independent. Some use pseudocode, some don't even have that much code and one of my favourite books used Pascal, of all things.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文