What is the difference between a data structure and a data type?

  • Google+ icon
  • LinkedIn icon
  • 2199 views

A data structure is a way of describing a certain way to organize peices of data so that operations and alogrithms can be more easily applied.  For example tree type datastructures often allow for efficient searching algorithms.

A data type describes peices of data that all share a common property. For example an integer data type describes every integer that the computer can handle. Often when refering to data types in practice you will be referencing primitive data types which are the most basic data types of a programming language for example int, string or array.  However in some languages like C you can define your own data types for example a data type of `person` could contain a string labled `name` and an integer called `age` which could be used to store the information for any person with an age and a name.

Tom B. GCSE Computing tutor, GCSE Maths tutor, Mentoring HTML & CSS t...

About the author

is an online GCSE Computing tutor with MyTutor studying at York University

Still stuck? Get one-to-one help from a personally interviewed subject specialist.

95% of our customers rate us

Browse tutors

We use cookies to improve your site experience. By continuing to use this website, we'll assume that you're OK with this. Dismiss

mtw:mercury1:status:ok