Algorithm and Data structure (Lecture # 2)
Terminologies:
1) BIT:
-BIT stands for "Binary digit".
-A BIT is used to store a single Binary '0' or a single Binary '1'.
-It is the smallest Binary '1';
-It is the smallest piece of information that can not be further divided.
2) Nibble:
-A combination of four related bits is called a NIBBLE.
3) Byte:
-A combination of two related nibbles OR eight related bits are called a BYTE.
4) Character:
-A byte is used to store a single character is a combination
OR
-A character is a combination two NIBBLES or eight BITS.
-A character is a small part of information and can be divided into BITS.
-A character can be alphabetic (Aa--->zZ), digits (0-9) and any special symbol.
ASCII:-
8-bits (0-9)
| |
Character
Total Character=2^8 = 256=> 0-255
5) Field:
-A combination of related characters is called a field.
-A field is usually meaningless, if it is treated all alone.
-A field is commonly read from top to bottom.
-A field can be
For Example; st_id, st_name etc
6) Records:
-A combination of same related field is called records.
-Records are usually read from left to right
-A records gives unit (complete) information about an entity e.g. student, fields in records is called degree of the RECORDS.
For Example:
7) File:
-A File is a combination of related Records.
-A File contains all the records of same type is:
e.g; A student file can't contain faculty records.
-Files are usually maintained by tables.
8) Block:
-A Block is a combination of some Records in a file that can be treated as a logical unit.
-There should be some commonalities between Records to create a Block.
e.g. Block of 'A' grades.
Dynamic set = Retrieved table
-Number of Records in a Block is called Blocking factor.
Query; Select *from student where address='Psh';
Operation on/for Data Structure:-
1) Creating:
-Designing/Building a new empty data list or bundle.
e.g. int a;
int a[3]
2) Inserting:
-Entering a new item in an location of a data list
a=5;
for(i=5;i<= 1; i++)
{
cin>>a;
}
3) Traversing:
-Visit each and every location of data list
-While traversing no other operation is applied.
e.g.
for(i=0;i<=2;i++)
count<<a[i];
4) Deleting:
-Removing/Erasing an element from a data list.
-Deleting is usually performed by means writing.
e.g. a=5;
a=6;
a=7;
print a;
-------------------------------------------------------------------------------------------------------------------------
1) BIT:
-BIT stands for "Binary digit".
-A BIT is used to store a single Binary '0' or a single Binary '1'.
-It is the smallest Binary '1';
-It is the smallest piece of information that can not be further divided.
2) Nibble:
-A combination of four related bits is called a NIBBLE.
3) Byte:
-A combination of two related nibbles OR eight related bits are called a BYTE.
4) Character:
-A byte is used to store a single character is a combination
OR
-A character is a combination two NIBBLES or eight BITS.
-A character is a small part of information and can be divided into BITS.
-A character can be alphabetic (Aa--->zZ), digits (0-9) and any special symbol.
ASCII:-
8-bits (0-9)
| |
Character
Total Character=2^8 = 256=> 0-255
5) Field:
-A combination of related characters is called a field.
-A field is usually meaningless, if it is treated all alone.
-A field is commonly read from top to bottom.
-A field can be
For Example; st_id, st_name etc
6) Records:
-A combination of same related field is called records.
-Records are usually read from left to right
-A records gives unit (complete) information about an entity e.g. student, fields in records is called degree of the RECORDS.
For Example:
Id
|
Name
|
Grade
|
Address
|
1234
|
Ali
|
A
|
Psh
|
2313
|
Akbar
|
A+
|
Isl
|
4568
|
Hamza
|
B
|
Pes
|
2545
|
Zohaib
|
B+
|
Lakki
|
7894
|
Hassan
|
A+
|
Kohat
|
7) File:
-A File is a combination of related Records.
-A File contains all the records of same type is:
e.g; A student file can't contain faculty records.
-Files are usually maintained by tables.
8) Block:
-A Block is a combination of some Records in a file that can be treated as a logical unit.
-There should be some commonalities between Records to create a Block.
e.g. Block of 'A' grades.
Dynamic set = Retrieved table
-Number of Records in a Block is called Blocking factor.
Query; Select *from student where address='Psh';
Operation on/for Data Structure:-
1) Creating:
-Designing/Building a new empty data list or bundle.
e.g. int a;
int a[3]
2) Inserting:
-Entering a new item in an location of a data list
a=5;
for(i=5;i<= 1; i++)
{
cin>>a;
}
3) Traversing:
-Visit each and every location of data list
-While traversing no other operation is applied.
e.g.
for(i=0;i<=2;i++)
count<<a[i];
4) Deleting:
-Removing/Erasing an element from a data list.
-Deleting is usually performed by means writing.
e.g. a=5;
a=6;
a=7;
print a;
-------------------------------------------------------------------------------------------------------------------------
Comments
Post a Comment