💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
data_structure (1).pptx
1.
2. Data structures are a specific way of organizing
data in a specialized format on a computer so that
the information can be organized, processed,
stored, and retrieved quickly and effectively. They
are a means of handling information, rendering
the data for easy use.
3. create a program:
header file
main function
block of statement between a curly braces
semicolon at end of the each statement in a block
# include<stdio.h>
printf();
scanf();
getc();
putc();
5. SYNTAX FOR PROGRAM:
# include<stdio.h>
#include<conio.h>
int main()
{
.................. ;
................... ;
............... ;
return;
}
6.
7. PRIMITIVE DATA TYPE:
int = this ia a data type which is used to represent a numbers in a
programming.It occupies 2 or 4 bytes in a memory location.
float = this is a data type which is used to represent a decimal
values . It occupies bytes 4 in a memory location.
char = this ia a data type which is used to represent a alphabets in
a programming.It occupies 1 byte in a memory location.
boolean =this expression is a logical statement that is either TRUE or
FALSE. It occupies 2 bytes in a memory location.
8. NON PRIMITIVE DATA TYPE:
Arrays a kind of data structure that can store a fixed-size
sequential collection of elements of the same type.
ARRAY:
data type arrayName [ arraySize ];
SYNTAX:
9.
10. // Program to take 5 values from the user and store them in an array
// Print the elements stored in the array
#include <stdio.h>
int main() {
int values[5];
printf("Enter 5 integers: ");
// taking input and storing it in an array
for(int i = 0; i < 5; ++i) {
scanf("%d", &values[i]);
}
printf("Displaying integers: ");
// printing elements of an array
for(int i = 0; i < 5; ++i) {
printf("%dn", values[i]);
}
return 0;
}
12. sparse matrices:
This ia an array which consists more zero element than non
zero value.
ex:
0 8 0 0
9 0 0 0
0 0 7 0
13. Stack is a linear data structure that follows a particular order in
which the operations are performed. The order may be
LIFO(Last In First Out)
stack:
14. stack operations:
push() = insert the element at top
pop() = pick up the element at the top
peek() =to know the value of element which entered last
top() = to know the ind value