Please enable JavaScript.
Coggle requires JavaScript to display documents.
Kump 6 - Coggle Diagram
Kump 6
Declaring Structure
-
2.The elements of structure, known as members can be of different data types.
3.Each structure you define can have an associated structure name which is referred to as structure tag.
4.To declare a structure, use the struct statement. It declares a new data type, with more than one member.
-
-
-
CASE STUDY
Declare a structure to illustrate student details contained information such as name, Id, Class and Session and CGPA.
-
Declare a structure called AddressInfo which holds an info such as address, town, state, and postcode.
-
ARRAY
What Is Array?
Array is a container which can hold a fix number of items and these items should be of the same type.
-
Important Terms
-
Index − Each location of an element in an array has a numerical index, which is used to identify the element.
Array Representation
-
-
-
Important Points
-
-
Each element can be accessed via its index. For example, we can fetch an element at index 6 as 9.
-
Diadvantages of Arrays
-
Array is static structure. It means that array is of fixed size. The memory which is allocated to array can not be increased or reduced.
The elements of array are stored in consecutive memory locations. So insertions and deletions are very difficult and time consuming.
Since array is of fixed size, if we allocate more memory than requirement then the memory space will be wasted. And if we allocate less memory than requirement, then it will create problem.
Data Structures Types
-
2.Linear & non-linear
1.Linear
The elements are adjacently attached to each other and in a specified order. It consumes linear memory space, the data elements are required to store in a sequential manner in the memory.
-
-
3.Static & Dynamic
-
2.Dynamic
Is a data structure that changes in size as a program needs it by allocating and de-allocating memory
-
ABSTRACT DATA TYPE (ADT)
1.An abstract data type or ADT is a mathematical model of a data structure. No implementation in detail.
-
3.Example: lists, sets, graphs, stacks are examples of ADT along with their operations.
-