elementary data structure organization data structures are building blocks of program program built using improper data structures may not work as expected so as programmer it is mandatory to choose most appropriate data structures for program the term data means value or set of values it specifies either the value of variable or constant ( marks of studentsname of an employeeaddress of customervalue of pietc while data item that does not have subordinate data items is categorized as an elementary itemthe one that is composed of one or more subordinate data items is called group item for examplea student' name may be divided into three sub-items--first namemiddle nameand last name--but his roll number would normally be treated as single item record is collection of data items for examplethe nameaddresscourseand marks obtained are individual data items but all these data items can be grouped together to form record file is collection of related records for exampleif there are students in classthen there are records of the students all these related records are stored in file similarlywe can have file of all the employees working in an organizationa file of all the customers of companya file of all the suppliersso on and so forth moreovereach record in file may consist of multiple data items but the value of certain data item uniquely identifies the record in the file such data item is called primary keyand the values in such field are called keys or key values for examplein student' record that contains roll numbernameaddresscourseand marks obtainedthe field roll number is primary key rest of the fields (nameaddresscourseand markscannot serve as primary keyssince two or more students may have the same nameor may have the same address (as they might be staying at the same place)or may be enrolled in the same courseor have obtained same marks this organization and hierarchy of data is taken further to form more complex types of data structureswhich is discussed in section classification of data structures data structures are generally categorized into two classesprimitive and non-primitive data structures primitive and non-primitive data structures primitive data structures are the fundamental data types which are supported by programming language some basic data types are integerrealcharacterand boolean the terms 'data type''basic data type'and 'primitive data typeare often used interchangeably non-primitive data structures are those data structures which are created using primitive data structures examples of such data structures include linked listsstackstreesand graphs non-primitive data structures can further be classified into two categorieslinear and non-linear data structures linear and non-linear structures if the elements of data structure are stored in linear or sequential orderthen it is linear data structure examples include arrayslinked listsstacksand queues linear data structures can be represented in memory in two different ways one way is to have to linear relationship between elements by means of sequential memory locations the other way is to have linear relationship between elements by means of links