Knowledge Management and Data Structure
Knowledge Management and Data Structure
and
Data Structure
Knowledge management and data
structure
• Data preprocessing is the first step of the
knowledge management process.
• Data in the data warehouse was preprocessed
and then fed to the knowledge management
tool.
• The historical data being preprocessed was
stored in a file.
• A Data structure refers to a scheme for
organizing related pieces of information.
Data Structure
• Data structure is a mathematical way for
storage of data in the computer memory.
• It is the way of storing and accessing the data
from the computer memory.
• So that large number of data is processed in
small interval of time.
Basic types of Data structure
• The basic types of data structures include:
• Files
• Lists
• Array
• Records
• Trees
• Tables
• Each of these basic structures has many
variations and allows different operations to be
performed on the data.
Types of Data Structure
There are two types of data structure
– Linear data structure
– Non linear data structure
Deletions
Removing a record or set of records form data structure is
called deleting process.
Merging
When two or more than two records are combined, this
process is called merging.
Copying
The creation of duplicate data item is called copying process.
Linear data structure
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List etc.
Array
• Array is the collection of finite homogeneous type of
data, which are stored in successive memory locations.
• The memory locations are identifies by a name which is
called the array name.
• The data items of the array are called the elements of
array and each data item is stored in separate memory
location.
• Each memory location within the array is identifies by
its position value, which is called the index of the array.
Array
Types of array
There are two types of array.
• One dimensional array
• Two Dimensional array
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List etc.
List
The arrangement of elements in some sequence is called
list. There are two types of list.
• Ordered List
• Unordered List
Ordered List
– The proper sequence of elements is called ordered list.
– For example The days of week, the month of year, seasons of
year.
Unordered List
– In this type of list the storage of element is not take place in
proper order.
– For example Stack, Queue, Dequeue, Circular Queue, Link List
Linear data structure
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List etc.
Stack
• Stack is that type of list in which insertion and
deletion of elements can take place from one
end. The end of stack is called Top pointer.
Full Stack If stack is full, False value is returned i.e Boolean
value
Under Flow
Example
– Pile of Trays in Cafeteria
– Pile of books in Library
Linear data structure
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List etc.
Queue
• Queue is that type of list in which insertion can take
place from one end called (Rear) and deletion can
take place from another end called (Front).
• Queue works on the principle of first in first out
(FIFO)
• List come First Serve and Last in last out (LILO).
Full Queue
It returns Boolean value false, if queue is full.
Destroy Queue
This operation deletes all the elements of the
queue and also deletes the structure of queue
from the computer memory.
Major Operation on Queue
Overflow Condition
When no more elements can be inserted in
the queue then this condition is called
overflow condition.
Underflow Condition
When queue is empty and no more elements
can be deleted from the queue then this
condition is called underflow condition.
Linear data structure
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List etc.
Circular Queue
• Circular queue provide flexible way for the
insertion of element in a circular way.
• In queue we are nor sure that when the rear
pointer goes to an end i.e Rear = N , overflow
condition occur, may be the same element from
the front are deleted, it is the major drawback of
queue.
• This drawback can be overcome with the help of
circular queue.
• In circular queue the insertion can be take place
by using this sequence 1,2,3, …… N
Circular Queue
Check for Underflow
When the front and rear pointer become equal that is
Front Rear 0
Underflow condition may arise.
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List.
Dequeue
• It is a linear data structure. This queue is
called double ended queue.
• In this type of queue insertion and deletion of
elements can be take place from both ends.
• In this queue, insertion and deletion of
elements from Rear and Front can take place
on the principal of Right and Left pointer.
Two types of Dequeue
Input restricted queue
In this type of queue, insertion can take place
only from one end and deletion can take place
from both ends.
• Array,
• List
– Stack,
– Queue,
– Circular Queue
– Dequeue
– Link List.
Link list
A linked list is a data structure which can change during
execution.
• Trees
• Files
• Graphs
Trees
• Trees are used to impose a hierarchical
structure on a collection of data items.
• For example, we need to impose a hierarchical
structure on a collection of data items while
preparing organizational charts and
genealogies to represent the syntactic
structure of a source program in compilers.
• So the study of trees as one of the data
structures is important.
Definition of a Tree
• A tree is a set of one or more nodes T such
that:
• There is a specially designated node called a
root
• The remaining nodes are partitioned into n
disjointed set of nodes T1, T2,…,Tn, each of
which is a tree.
Trees
• This is a tree because it is a set
of nodes {A,B,C,D,E,F,G,H,I},
with node A as a root node
• And the remaining nodes
partitioned into three disjointed
sets {B,G,H,I}, { C,E,F} and {D},
respectively.
• Each of these sets is a tree
because each satisfies the
aforementioned definition
properly.
Trees
• Even though this is a set of
nodes {A,B,C,D,E,F,G,H,I},
with node A as a root
node, this is not a tree
because the fact that node
E is shared makes it
impossible to partition
nodes B through I into
disjointed sets.
Trees
Degree of a Node of a Tree
The degree of a node of a tree is the number of sub trees having this
node as a root. A 1 B,C,D 0
Degree of a Tree
The degree of a tree is defined as the maximum of degree of the nodes
of the tree, that is, degree of tree = max (degree(node i)
for I = 1 to n)
Degree of a Tree 1
• Trees
• Files
• Graphs
File
• Collection of logical related records is called file.
• It is a set of records that is stored on secondary
storage devices like magnetic tap, tape drives,
floppy disc, hard disc, flash etc, when created.
• There are three types of files.
• Sequential File
• Index sequential file
• Random/ Relative file
Types of File
Sequential File
• In sequential file, the records are stored in sequential order, in
which they are inserted.
• This type of file is can be stored on magnetic tape, magnetic
disc and hard disc.
• Trees
• Files
• Graphs
Graphs
• A set of items connected by edges. Each item is called a
vertex or node. Formally, a graph is a set of vertices and
a binary relation between vertices, adjacency.
Undirected graph
• A graph whose edges are
unordered pairs of vertices.
That is, each edge connects
two vertices.
Types of Graphs
Dense graph
• A graph in which the
number of edges is close
to the possible number of
edges.
Sparse graph
• A graph in which the
number of edges is much
less than the possible
number of edges.
Types of Graphs
Labeled Graph
• A graph which has labels
associated with each edge or
each vertex.
Weighted graph
• A graph having a weight, or
number, associated with
each edge. Some algorithms
require all weights to be
nonnegative, integral,
positive, etc.
Graphs
• Graphs are so general that many other data
structures, such as trees, are just special kinds
of graphs.