Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: data structure and array notes for beginners
Description: These notes are for beginners these notes contain - 1 data structure introduction 2 array and its types
Description: These notes are for beginners these notes contain - 1 data structure introduction 2 array and its types
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
1
...
you will see what is the need of ferry what does any types of ferry
how areas can be declared how arrays can be
...
declared and how data can be
stored in memory
...
be converted into binary it 's binary number sorry that
is in 32 bits
...
faerie:
we have to process large amount of return that is why the concept of array came
now you will modify this declaration such that under one variable name we can
store roll numbers of all 60 students that is what array now how you can do this
...
The data is stored in consecutive locations or continuous locations one after
another
...
The data is
stored in binary form and the address of the data is calculated in hexadecimal
form
...
In next
video, I'm going to discuss it how the data is to be taken from the user how the
data is to be stored in the array
...
After that, we will discuss
what is 2d array as well as how 2d arrays are to be accessed from the air fine
...
2 Array Operations | Deletion from Array |
Explanation with Code | Data Structure
Understanding how to delete data from a specific position will also
make it easier to delete data from the beginning or end of the array
...
One variable,
size, is used to determine the maximum size of the array
...
The user will then enter the elements of the array,
which will be initialized at runtime
...
For
example, if they want to delete data from position 2, I will shift the
values from position 3 to 4 and reduce the size of the array by 1
...
To print the updated array after deletion, I
will use a for loop to print each element of the array
...
If the position is invalid, such as -1 or greater than
the size of the array, I will print "invalid position"
...
When deleting data from the end of the array, I will simply
decrement the size of the array
...
The time complexity of the deletion operation depends
on the position from which the data is to be deleted
...
However, if
the array is unsorted, a quicker algorithm is to pick the last element of
the array and put it in the position to be deleted
...
1
...
For example: if the user wants to store marks
of 500 students, this can be done by creating
500 variables individually but, this is rather
tedious and impracticable
...
An array in C Programing can be
defined as number of memory locations, each
of which can store the same data type and
which can be references through the same
variable name
...
These similar
quantities could be marks of 500 students,
number of chairs in university, salaries of 300
employees or ages of 250 students
...
These
values could be all integers, floats or
characters etc
...
One-dimensional arrays
...
Multidimensional arrays
...
Arrays must be declared before they
can be used in the program
...
The array size
is always mentioned inside the “[]”
...
The initializing values are
enclosed within the curly braces in the
declaration and placed following an equal sign
after the array name
...
Array can also be
initialized after declaration
...
int age [5] ={2,3,4,5,6};
It is not necessary to define the size of arrays
during initialization
e
...
int age[]={2,3,4,5,6};
In this case, the compiler determines the size
of array by calculating the number of elements
of an array
...
Accessing array elements
In C programming, arrays can be accessed and
treated like variables in C
...
Arrays can be accessed and updated using its
index
...
An element can be
updated simply by assigning
A[i] = x;
Example of array in C programming
/* C program to find the sum marks of n
students using arrays
#include
Important thing to remember in C arrays
Suppose, you declared the array of 10 students
...
You can use array members
from student[0] to student[9]
...
In this case
the compiler may not show error using these elements
but, may cause fatal error during program execution
...
To access a particular element
from the array we have to use two subscripts one for row number
and other for column number
...
The array holds i*j elements
...
Then this array can hold i*j*k*m numbers of
data
...
For example :
int smarks[3][4];
Initialization of Multidimensional Arrays In C:
multidimensional arrays can be initialized in different
number of ways
Title: data structure and array notes for beginners
Description: These notes are for beginners these notes contain - 1 data structure introduction 2 array and its types
Description: These notes are for beginners these notes contain - 1 data structure introduction 2 array and its types