Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DBMS
Instructor: B. S. Manoj
Lecture-5
These slides are the works of many people who own the copyright for their work.
You may use it for your class room purpose at IIST for AV 482 (Data Structures
And DBMS) in July-November 2016 semester. Any other form of commercial or
Non-commercial public distribution may require prior permissions in writing from the
Copyright owners.
8/12/2016
General Updates
Course Website Registration verification
If you have dual account registrations, keep only one.
Your friends, who left the course, also may unenroll.
Cleaning the course registration is required for grading.
Home Work-I
Questions can be found at the end of todays slides.
Answers shall be posted online at course website.
Programming Assignment-I
Submit the code the time complexity result comparison
document online
8/12/2016
Suggested G2 slot
DBMS Semi-slot
8/12/2016
typedef int
PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;
struct Node
{
ElementType Element;
Position next;
};
P=1
P = CursorSpace[0].Next;
CursorSpace[0].Next =
CursorSpace[P].Next;
Slot
return P;
}
P
Elem
ent
Next
3
8/12/2016
Slot
10
Elem
ent
0
P1
..
..
10
Elem
ent
Next
..
..
10
Next
Elem
ent
Next
P=1
10
Elem
ent
Next
10
Slot
ent
10
P=2
Next
8/12/2016
Slot
Elem
ent
Next
10
8/12/2016
Slot
Element Next
Slot
Element Next
Header
Header
Header
10
Header
10
10
10
Find(.)
Slot
Elemen Next
t
Header
While(P &&
CursorSpace[P].Element != X)
{
P = CursorSpace[P].Next;
P=8
}
10
10
Return P;
}
8/12/2016
P=8
TmpCell
0
If(TmpCell == 0)
Error(Out of space);
CursorSpace[TmpCell].Element = X;
CursorSpace[TmpCell].Next = CursorSpace[P].Next;
CursorSpace[P].Next = TmpCell;
}
8/12/2016
Slot
Elem
ent
Next
Head
84
58
7
8
9
10
10
Delete(.)
Void Delete(ElementType X, List L)
{
Position P, TmpCell;
P = FindPrevious(X, L);
if(!IsLast(P, L))
{
TmpCell = CursorSpace[P].Next;
CursorSpace[P].Next =
CursorSpace[TmpCell].Next;
CursorFree(TmpCell);
}
TmpCell
}
Slot
Elemen Next
t
Header
10
82
10
P=7
8
8/12/2016
11
8/12/2016
12
8/12/2016
13
8/12/2016
14
Programming assignment-1
Create a large doubly linked list of N items (preferably
greater than 1000)
Insert or Delete a randomly chosen element and measure
the time required for a number of operations (>50)
Compare the time taken with the theoretical estimate of
the time complexity for the insert or delete operations
For the insert or delete operations, position is given as the
number of elements from the list head (Traversal may also
be part of the time complexity measurement)
Create a simple comparison graph in a document (word or
pdf) and submit it along with the code (in a single .c file).
Submissions method: online
Deadline: will be IIST
updated
AV 482: Data Structures and DBMS
8/12/2016
July-November 2016
15
Home Work-1
8/12/2016
16
8/12/2016
17
8/12/2016
18
We covered
List ADT
Implementations
Pointer based
Array with Pointer based
Cursor based
8/12/2016
19