Best medium to learn Data structures in Java

Microsoft Lksos
Mar 17 14 Comments

Just getting started with the interview prep and I'm looking for a book/videos which cover all the DS with built in classes in Java. Like C# has built in classes for Stacks, Queues, LinkedList, etc.

So far all the books I'm seeing for Java are implementing the data structures from scratch while it's not realistic to implement them in a real interview, atleast in a phone screen. I'm comfortable with all the data structures in C# but need a way to pick up the Java counterparts which has all the documentation for every data structure class.

Can anyone please recommend the best place for this?

comments

Want to comment? LOG IN or SIGN UP
TOP 14 Comments
  • New / Mgmt VSwf01
    Don't conflate two things at once. Do you know Java? Then pick a book that doesn't use Java that way you can be forced to implement them yourself. The only way to truly know you understand something is to implement it independently. If you don't know Java then learn Java first or use C# and after you learn to implement in C# you can learn Java.
    Mar 17 4
    • Microsoft Lksos
      OP
      I can implement it in C# and Java as well. My point is that in real interviews you shouldn't need to waste time just implementing a data structure like Priority Queue when there's already an inbuilt implementation available for it and you can just get on with solving the actual problem at hand.
      Mar 17
    • New / Mgmt VSwf01
      I don't get your point, if they ask you to implement it, it doesn't matter if there's a library. Implement it. If you wish to be fast during an interview, consider learning python.
      Mar 17
    • Microsoft Lksos
      OP
      ***Iff they ask to implement, I certainly will.
      If there's no such restriction, I need to know the inbuilt implementations and where do I find it is my original question. Savvy?
      Mar 17
    • LinkedIn qQiF85
      The interviewer will understand if you don't get the name exactly right of something that exists, or if you claim some data structure exists in a library. As long as you can explain how the data structure works, and the guarantees it provides, you're fine.
      Mar 17
  • eBay / Eng joiutv
    nothing better than leetcode..just go at it and submit solutions in java..make sure you beat at least 90% of the submission with your logic..that will ensure using right data structure and algo
    Mar 17 1
    • Microsoft Lksos
      OP
      I need to know the properties and methods of the data structures for that. Also, leetcode doesn't have any documentation for the data structures especially heaps, priority queues, etc.
      Mar 17
  • Morgan Stanley cdewrxhrjw
    Robert Sedgewick’s Algorithms
    Mar 17 0
  • New Kudzai
    Try Elements of Programming interviews in Java along with Data Structures and Algorithms in Java by Drozdek
    Mar 17 0
  • Microsoft Sbwv22
    Algorithms 4th edition by Robert Sedgewick, if you want to implement all the foundational data structures / algo.

    University level text, but superbly written code in Java (none of that psuedo code bulshit), with amazing explanations and lots of discussions.
    Mar 17 0
  • ‘Cracking the Coding Interview’ is a must read.
    Mar 17 0
  • Google camelCase
    Data structures in Java are just data structures. If you are asked to implement a queue or reverse a list, they are not asking to recall the Java API, but to implement from scratch. It doesn’t hurt to know the collection classes in java.util. Just look up the java.util javadocs. You should at least know lists, maps, queues.
    Mar 17 0
  • Amazon DynamoDB
    Implementing them from scratch is the best way to learn them. If you don't want to do that, just browse the Collections classes that are in Java.
    Mar 17 0