≡ Menu

How to Program with Java – Podcast Episode 4

Data Structures



Definition:

In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.

– the key here is that data structures use data efficiently
– different data structures are best suited to different situations
– reduces the amount of variables

What kinds of ways could you organize data?

– List
– Map
– Set

– These are known as Collections (generic term)

– List – Store bunch of items for later iteration
– Map – For a given (something) what is the (something else) – key/value
– Set – Used to maintain a unique List

List Example – Contacts

Map Example –
“Honda” -> “Civic”, “Prelude”
“Toyota” -> “Corolla”, “Celica”, “Rav4″
“Ford” -> “Focus”, “Mustang”
“Audi” -> “R8″

Set Example – Check to see which words were used in a sentence

Interesting Note: You can use one Collection inside of another

Homework:

https://howtoprogramwithjava.com/the-5-basic-concepts-of-any-programming-language-concept-3/

Interesting Links:

http://javapdf.org




Don't code another minute until you have these tools.
Get this 1-page PDF that outlines the top 7 Tools that Java Professionals use every day.

{ 10 comments… add one }

  • Lam October 7, 2012, 11:03 am

    Hey Trev, your site and weekly posts are great and very helpful. This makes the initial stage into programming more enjoyable. Thank you and keep up with the good work

    • Trevor Page October 7, 2012, 11:11 am

      Always a pleasure Lam, I’m glad you find these tutorials helpful, keep up the learning!

  • Norman October 13, 2012, 8:30 pm

    hey Trevor, thanks a lot! I have been listening to your podcasts and you have cleared a lot of stuff for me already Im only starting to understand better (even after Barnes & Kolling).
    keep up the good work! cant wait for your next podcast!

    • Trevor Page October 14, 2012, 9:27 am

      Thanks Norman, that’s some great feedback, I really appreciate it!

      I have been so stupidly busy this past week, but I’m going to try and get a new podcast episode recorded and released in the next 12 hours :)

    • Trevor Page October 14, 2012, 11:12 am

      PS… thanks for buying my eBook, now I *really* have to record an episode for you ;)

  • naftaly ngari February 22, 2013, 10:29 pm

    trevor you are a great teacher and i have just started learning programming and with these podcasts and tutorials i will be a good programmer. i could not even get started because i met one lecturer who made me think that programming is only for the very bright students and i had to quit . but now i know i will go far. thank you and God bless you keep up with your good work.

    • Trevor Page February 23, 2013, 10:18 am

      Clearly that lecturer wants to think that he’s smarter than he actually is! Good for you for ignoring him and pushing forward, it shows that you’ve got a good head on your shoulders.

      Let me know if you have any questions about programming, I’ll be glad to help you out.

  • Jonathan October 20, 2013, 3:21 pm

    BTW, the page title says “Control Structures”, not “Data Structures”. Confused me for a little bit.

  • uday August 27, 2014, 9:57 pm

    Hi
    I like your podcasts. Thanks for sharing very good java class.
    I really like it very much. It is possible to contact you via email?

    Thanks,
    Uday

Leave a Comment

Powered by sweet Captcha