Anda di halaman 1dari 7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora
AskQuestion

AskorSearchQuora

DataStructures

Knowledge

Algorithms

Learning

HowtoQuestion

Read

+2

HowdoIstartlearningorstrengthenmyknowledgeof
datastructuresandalgorithms?
Answer

Request

Follow 4.5k

Comment Share 34

Downvote

PromotedbyHelpjuice

World'smostpowerfulknowledgebasesoftware.
Simple,powerful,instantsearch,enterpriseanalytics,noticketing.Trustedbyover3,000
companies.
LearnMoreatHelpjuice.com

100+Answers
HarshThakar,ComputerScienceGrad
WrittenJul31,2013
OriginallyAnswered:HowdoIlearnDataStructuresandAlgorithms?

Data Structures and Algorithms (DSA for short) is an implementation based course.
Many companies stress heavily on concepts from this course in their interviews. In
order to master this course, you need to be strong with both the theory and

Answer

Notifications

FRED

RelatedQuestions
ShouldIlearnalgorithmdesigntechniquesanddata
structuresbeforestartingpracticinginCodeChef?
Willtheknowledgeofalgorithmsanddatastructures
helpmewithdatamining?
HowshouldIstartlearningdataStructuresand
algorithms?Ihavesolvedaround80problemson
Codechef(Adhoc).HowdoIstartfrombasics?
Canyoulearnandmasteralgorithmsanddata
structureswithoutbeinggoodinmathematics?
IwanttolearndatastructureandAlgorithm,shouid
learningdatastructurefirstthenAlgorithmorstart
learningthematthesametime?(Th...
Whatarethebenefitsoflearningalgorithmsanddata
structuresinDataEngineering?
WhyshouldIlearndatastructuresandalgorithms?
Whichprojectscanbemadeusingtheknowledgeof
datastructuresandalgorithms?
HowcanIlearndatastructureandalgorithmstheory
withoutanypriorknowledgeinmathematics?

implementation of various Data Structures and Algorithms.


1. Read. You should start reading Introduction to Algorithms by Cormen et. all.
This book is said to be the best for DSA but it can become a bit dicult to

Isthereanyneedofpriorknowledgeofgraphtheory
beforestudyingdatastructuresandalgorithms?
MoreRelatedQuestions

read it while working with your course load. You can instead use this as a
reference book supplementing your recommended course book.
2. Implement the Data Structures you read about. While reading about them
might give you a fair idea of they work, it is dierent from actual
implementation where you will need to take care of boundary cases. There
will be cases where you forget null checks and mess up your entire code.
3. Understand complexity. You need to be able to calculate the space

QuestionStats
4,588Followers
1,250,267Views
LastAskedMon
131MergedQuestions
Edits

complexity of various data structures, the time complexity of their


operations and the time and space complexities of various algorithms. You
should be able to judge which algorithm works better under various
conditions.
4. Practice. Solve problems from various online judges like codechef,
hackerrank, topcoder and spoj. This will help you choose the optimal data
structure or algo for a particular problem. You can even search for problems
specic to the data structure or algo you want but where's the fun in that?

Additionally you can also check out MIT's video lectures on OCW or relevant courses
on Coursera
External Links
1. http://www.codechef.com/
2. https://www.hackerrank.com
3. http://www.topcoder.com/
4. http://www.spoj.com/
5. Introduction to Algorithms: Thomas H. Cormen, Charles E. Leiserson,
Ronald L. Rivest, Cliord Stein: 9780262033848: Amazon.com: Books

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

1/7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora

6. Introduction to Algorithms
AskorSearchQuora

AskQuestion

Read

Answer

Notifications

FRED

92.4kViewsViewUpvotes
Upvote 214

Downvote Comments 2

RobertLove,SoftwareEngineeratGoogle.
WrittenJun29,2013FeaturedinForbesUpvotedbyKiranKannar,Onelove.
C++wasmyfirstprogramminglanguage.andNehaNarkhede,CofounderandCTO
atConfluent
OriginallyAnswered:HowdoIstrengthenmyknowledgeofdatastructuresandalgorithms?

I see it time and again in Google interviews or new-grad hires: The way data
structures and algorithmsamong the most important subjects in a proper computer
science curriculumare learnt is often insucient. That's not to say students read
the wrong books (see my recommendation below) or professors teach the wrong
material, but how students ultimately come to understand the subject is lacking.
The key to a solid foundation in data structures and algorithms is not an exhaustive
survey of every conceivable data structure and its subforms, with memorization of
each's Big-O value and amortized cost. Such knowledge is great and impressive if
you've got it, but you will rarely need it. For better or worse, your career will likely
never require you to implement a red-black tree node removal algorithm. But you
ought be ablewith complete ease!to identify when a binary search tree is a useful
solution to a problem, because you will often need that skill.
So stop trying to memorize everything. Instead, start with the basics and learn to do
two things:
Visualize the data structure. Intuitively understand what the data structure
looks like, what it feels like to use it, and how it is structured both in the
abstract and physically in your computer's memory. This is the single most
important thing you can do, and it is useful from the simplest queues and
stacks up through the most complicated self-balancing tree. Draw it,
visualize it in your head, whatever you need to do: Understand the structure
intuitively.
Learn when and how to use dierent data structures and their algorithms in
your own code. This is harder as a student, as the problem assignments you'll
work through just won't impart this knowledge. That's ne. Realize you won't
master data structures until you are working on a real-world problem and
discover that a hash is the solution to your performance woes. But even as a
student you should focus on learning not the minutia details but the
practicalities: When do you want a hash? When do you want a tree? When is a
min-heap the right solution?
One of the questions I ask in Google engineering interviews has a binary search tree
as a potential solution (among others). Good candidates can arrive at the binary
search tree as the right path in a few minutes, and then take 10-15 minutes working
through the rest of the problem and the other roadblocks I toss out. But occasionally I
get a candidate who intuitively understands trees and can visualize the problem I'm
presenting. They might stumble on the exact algorithmic complexity of some
operation, but they can respond to roadblocks without pause because they can
visualize the tree. They get it.
As for a book, there is but one: Introduction to Algorithms

by Cormen, Leiserson,

Rivest, and Stein, otherwise known as CLRS.


If you want another text, perhaps one with more examples in a specic language, I
recommend Robert Sedgewick's Algorithms in C++

or Algorithms in Java , as

appropriate. I prefer CLRS as a text, but you might nd these a better teaching aid.
332.9kViewsViewUpvotesAnswerrequestedby1person

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

2/7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora

Upvote 3.6k

Downvote Comments 23+

AskorSearchQuora

AskQuestion

Read

Answer

Notifications

FRED

YoshiyaMiyata,Lovesolvingalgorithmicproblems
WrittenAug15,2012
OriginallyAnswered:HowdoIlearnDataStructuresandAlgorithms?

There are lot of great books, online resources, and online courses that teaches you
basics of algorithms and data structures. I will list them below:
Books:
Introduction to Algorithm
Commonly known as CLRS, taking the rst letter from each of the co-writers of the
book. One of the most comprehensive algorithm book out there. It has over 1000
pages of content, covering wide range of topics.
http://www.amazon.com/Introducti...
Algorithm Design
Written by John Kleinberg and Eva Tardos. Another great algorithm book. It covers
everything that the beginner in algorithm has to learn. Compared to CLRS, this book
is more focused on teaching the essentials where else CLRS has more broader scope.
http://www.amazon.com/Algorithm-...
Algorithm Design Manual
Written by Steven Skiena. This book has a very unique style. Second half of the book
contains a huge catalog of algorithms, which serves as a great reference when solving
algorithmic problems. Book covers key algorithmic concepts. Some of the algorithm's
implementation is given in C code. Compared to previous two books it is much
shorter in length.
http://www.amazon.com/Algorithm-...
Online Courses:
MIT 6.046J Introduction to Algorithm
Introductory level algorithm class for undergraduates at MIT. CLRS is used as
textbook for this class.
http://ocw.mit.edu/courses/elect...
MIT 6.851 Advanced Data Structures
This is a graduate level class and it is very academic, so it is not for beginners, but it is
a great resource if you want to learn more advanced data structures concept.
http://courses.csail.mit.edu/6.8...
Online Resources:
TopCoder Algorithm Tutorial
This set of great algorithm tutorials were written by various TopCoder competitors.
Some of them covers very basic algorithmic concepts, while others cover very minor
but useful concepts not covered on any of the other resources.
http://community.topcoder.com/tc...

These are all very generic resources that teaches basics of algorithm. If you are

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

3/7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora

looking for more specic eld of algorithm then it is often helpful to look for
AskQuestion
AskorSearchQuora
academic papers dealing with the topic.

Read

Answer

Notifications

FRED

69kViewsViewUpvotes
Upvote 139

Downvote Comment

JoshuaPan,GloballeaderonCodeFights,USACOPlatinumcompetitor,
CodeForcer
WrittenMar21,2016
OriginallyAnswered:HowcanIlearndatastructuresandalgorithmswell?

Data structures and algorithms are hard to learn. Here's a huge list to show how much
there actually is out there: Data Structures and Algorithms .
So how do you improve on this?
Mastering these things require two things: understanding and implementation.
Here are some steps to follow.
#1 Read about the data structures/algorithms. I have given you a good list of things
to study, but this won't get it entirely. Here is another link to nd lists of algorithms:
What are the algorithms required to solve all problems (using C++) in any competitive
coding contest?
Obviously, this does not cover everything. Reading CLRS algorithm book will
also be really nice.
Algorithms Books: If CLRS is considered as quite hard book for
beginners, what another great book would you recommend for
beginners?
You will see that reading about algorithms and data structures is kind of like
supply and demand. The more problems you do, the more algorithms
you've got to study up on.
Don't need to implement right away. Make sure to understand the details of
the data structures/algorithm, so that if there is a little twist in a problem,
you'll be able to pick it up immediately and know where to change your code
in your data structure or algorithm. I would recommend writing out the steps
on a piece of paper and being the computer and doing each step of the
algorithm or each part of the data structure by hand.
#2 Practice, practice, practice. This should be simultaneously done with #1. Never
just do #1 or #2; this will not help you. You need to implement AND learn how the
algorithm works, so that you are able to tweak it however you want.
There are so many online coding platforms: What are the various online
programming contests?
Here are the ones I would say to focus on:
CodeForces

(data structures): ability to look at other people's

solutions, weekly contests, no shortage of problems, most problems have


editorials
HackerRank

(algorithm domain): similar to CodeForces, able to look

at other people's solutions, most problems have editorials


HackerEarth

(newly released data structure track): lots of problems,

plus editorials (have to unlock)


Others: USACO Training Pages, USACO past problems, HackerEarth,
TopCoder, SPOJ*, CodeChef*, online judges*
*solutions and editorials are rare in these cases, you will have to google
search or ask questions

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

4/7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora

#3 Implement. Get a working code ready and debug if necessary. You should be able
AskQuestion
AskorSearchQuora
to look at your piece of paper and code up the data structure/algorithm pretty simply.

Read

Answer

Notifications

FRED

If you get stuck, you might have either misunderstood the algorithm/data structure
(Go back to step 1) or consult a pseudocode (either on Codechef or HackerEarth Code
Monk or TopCoder tutorials or etc.).
Some tutorials on data structures which you can learn from.
Data Science Tutorials

(pseudo-code)

Data Structures and Algorithms

(above link)

Code Monk - Be a better programmer

or Notes on HackerEarth

(in

lots of dierent languages)


Studying data structures is about understanding them, not just
implementing them. This is because changing data structures to t a
question requires you to understand how it works. Thus, it doesn't really
matter which language the data structure is coded in; just try to understand
it by doing it by hand.
Similarly, deal with algorithms the same way. The links are above for
practice. Some reference links (maybe help?): Algorithm | Code Accepted
#4 Don't stop even if you get stuck. Get help immediately. Do one or multiple of the
following:
Try nd other people's solutions or read the editorial. Get the main idea
of the solution. Now CLOSE the solution and implement your without
reading the solution again. This is quite important, so that the
algorithm/solution will sink into your head. This is why I gave you some
websites to use above. They have editorials, which helps a lot.
All coding problems have patterns. You will always see similar problems all
the time. Thus, strategies and algorithms you used will also pass over.
Remember keywords that strike an algorithm. This will play a big role in your
success as a competitive coder.
#5 Do contests (for fun if you aren't a competitive coder). There is no better practice
than actual contests. Contests help with your ability to contain your stress and will
test your strengths to the maximum. After each contest, make sure to solve all the
questions that you did not solve during the contest. This is a major key.
#6 Have fun. You really can't be good at something if you don't like it. So have fun!
This was a really intense breakdown of algorithms/data structure prep for competitive
programming, but the idea for just learning algorithms and data structures still
applies. The point is practice, and practice with the right resources. Good luck.
Related Answers:
What is the best way to practice with algorithms and data structures?
How should I learn algorithms and solve problems on CodeChef, SPOJ step
by step?
How can I improve my data structure and algorithm knowledge ? I can give 2
hours a day.
13.4kViewsViewUpvotes
Upvote 41

Downvote Comment

KunalSuri,Awannabeprogrammer.
UpdatedFeb13,2015
OriginallyAnswered:HowdoIlearnDataStructuresandAlgorithms?

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

5/7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora

WARNING:- This answer might seem be long but contains my experiences with this
AskQuestion
AskorSearchQuora
fundamental eld.

Read

Answer

Notifications

FRED

The book "Introduction to Algorithms" (CLRS) mentioned in all the posts is


considered bible of this eld. However, I think that if you are a beginner in this eld
with a moderate programming experience and an average mathematical background,
this book might have a very steep learning learning curve which you should avoid at
this point of time. I am not saying that steep learning curve is bad but as a beginner,
your focus should be to ensure an intuitive understanding of algorithms along with
the knowledge of implementing those algorithms in your language of choice. Once
you get this step right, you can start drilling down to the technical details of various
data structures and algorithms. When you will start studying the technical details,
"Introduction to Algorithms" would prove to be an invaluable guide and reference.
Once you study this book completely, you should be able to understand most of the
match editorials of algorithmic competitions - solving one by yourself would need
more than the knowledge of algorithms, it needs practice. But that is a topic for other
discussion.
Anyways, CLRS assumes a fair amount of background on the part of the reader. If you
do have an exceptional instructor who takes care of the intuition and implementation
part, then by all means go for this book. But if you are not that lucky, then I would
suggest you to begin with reading How to Solve it by Computer

. This is a book

written for people like you and me who want to enter into this beautiful eld but lack
the weapons in the arsenal to make it past the gates of this mansion. Also, this book is
written without emphasizing any language and hence follows a pseudocode approach which is very important as it works as a detox to the whole "languageoriented" thinking which makes it dicult to think about complex problems because
you are too focused on the programming language that you forget to look at the
problem.
However, if you are not very strong in programming and need a book that teaches
algorithms by implementing them in a programming language, I would seriously
recommend Sams Teach Yourself Data Structures and Algorithms in 24 Hours: Robert
Lafore: 978067231633g3: Amazon.com: Books

. It's a very well written book with

very lucid explanation. Having read it myself, I can vouch for the eectiveness of this
book. Don't try to nish o this book in 24 hours. Take your time to read it. Read it
thoroughly. It won't take you far but will make your basics in DS/Algo as well as C++
very strong. If you read this book, I don't think that you'll need the book I mentioned
above. After reading this book, go for CLRS. You will have the treat of your life. If you
are Java person, then studying Amazon.com: Bundle of Algorithms in Java, Third
Edition, Parts 1-5: Fundamentals, Data Structures, Sorting, Searching, and Graph
Algorithms (3rd Edition) (Pts. 1-5) (0785342775785): Robert Sedgewick: Books

will

make your base very strong. However, it takes a rigorous route and teaches you many
algorithms. For learning these topics in C, take a look at Algorithms in C, Parts 1-5
(Bundle): Fundamentals, Data Structures, Sorting, Searching, and Graph Algorithms
(3rd Edition): Robert Sedgewick: 0785342756081: Amazon.com: Books . I haven't
studied this series but since the writer is the same, so the pedagogy should be similar.
Also, algorithms are always the same. It is the implementation that changes,so don't
panic if you nd one algorithm written in two dierent languages and you are unable
to understand one or the other.
91.9kViewsViewUpvotes
Upvote 359

Downvote Comments 8

AbhimanyuMongandhAmbalath,MastersinCSatIITKanpur
WrittenMay19,2013
OriginallyAnswered:Whicharesomeofthemusthavebooksforalgorithmsanddatastructures?

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

6/7

1/12/2017

(1)HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms?Quora

I have a few books that I recommend a lot


AskorSearchQuora

AskQuestion

Read

Answer

Notifications

FRED

Algorithms
1) Algorithm Design 1st Edition by

Jon Kleinberg , Eva Tardos

One of the

best books for Algorithms and takes a good eort in making you understand the
intution behind the Algorithm, which I have found to like a lot.
2) The Algorithm Design Manual by

Steven S. Skiena

Once you get past

Kleinberg, this book will introduce you to a wide range of problems, this book is a
example by example book, and hence may need basic level knowledge.
Graph Theory
I specialized in that, and hence even though you may not need them, suggesting the
following.
1) Introduction to Graph Theory 2nd Edition by Douglas B West.

- This is my

favorite book, and has almost everything on Graph theory, but lacks a intutional idea.
2) Graph Theory 01 Edition by Harary -

A classic book that is easy to read but a lot

old by Harary, introduces Graph theory wonderfully.


3) Graph Theory 0004 Edition by

Reinhard Diestel -

Standard text book for

Graph theory, and does a good job at that, but personally I like the above two books
for dierent reasons better.
References
1) Introduction to Algorithms 3 Edition -

I nd this book useful only as a reference,

when I need to know stu, the algorithms and data structures, are presented as is,
without any amount of intuition or anything. But if you have a technical doubt in
algorithms, chances are that this book will answer it. So please do use this as a
reference book. Chances are you will nd better text books for each of the topics in
CLRS.
18.9kViewsViewUpvotes
Upvote 71

Downvote Comment

TopStoriesfromYourFeed
PopularonQuora

PopularonQuora

PopularonQuora

Whatarethemostcommonlies
toldbyprogrammers?

Whatisthecreepiestthingyour
parenthaseverdone?

Ifhumansareshottodeathforthe
next100,000years,wouldthey
evolvetohavebulletproofskin?

GeoffreyBans,7+yearsprogramming
mywaytosuccess

NatalieMcGuire,Toomuchlife
experience

UpdatedMon

UpdatedSun

AntonyPateman,Fulltimefather
UpdatedJan6

My girlfriend calls:

My parents had bought a waterbed and

Here's evolution simplied: Twenty

GF: Hey honey,

said my siblings and I could sleep in it one

people sit on the shore of a lake. The lake

whats up? Can we go

night. My parents were having some

is wide, let's say thirty miles, bank to

to the movies this

company over and sometime that

bank. Suddenly a big monster appears,

afternoon? Me: Sorry,

evening, my dad came in and spooned

wanting to eat twenty people. The twenty

Im really busy now. I

me. I was a p...

...

am working on the algorithm for our


companys next social app. **Im actually
p...

ReadInFeed

ReadInFeed

https://www.quora.com/HowdoIstartlearningorstrengthenmyknowledgeofdatastructuresandalgorithms

ReadInFeed

7/7

Anda mungkin juga menyukai