Skip to main content

Posts

Showing posts with the label Array

Types of Data Structure

Types of Data Structure * Primitive data structures * Non-primitive data structures Primitive Data Structures Primitive Data Structures are the basic data structures that straightforwardly work upon the machine instructions.They have various representations on different computers. The term "data type" and " primitive data type " are commonly used interchangeably. This data types are predetermined types of data, which are supported by the programming language. For example, integer, character, float, string and pointer are all primitive data types. Programmers can utilize these data types when they creating variables in their programs. For example, a programmer may create a variable called "lastname" and define it as a string data type. The variable will then store data as a string of characters. Types of  Primitive Data Structure - * Integer. * Float. * Char * Pointer Integer -  An...

Non-primitive data structures

Array- An array is defined as a set of finite number of homogeneous elements or data items. It means on array can contain one type data only, either all integer all following point number all character, declaration of array is as follows- int a[6] where int specified the data types or type of element array shows- A 'a' is the name of Array and the number specified inside the bracket is the number of element an array can store. Following a some of the concept to be remember about array - The number of element that can be in an array that is the size of an array its name is given by the following equation. [(upper bound - lower bound) + 1] Array can always be read or written through loop - a) for reading an array      for(i=0; i<=9; i++0 { scanf( "%d" , &a[i]); } b) for writing an array  for (i=0; i,=9; i++) { printf("%d" , a[i]); } List -  A list (Linear Linked List) can be defined as a c...