Archive for April 2008


April 1, 2008


………The Team Work of Bhanu,Swarna & Karthik    


Hi we are Studying 4th C.S.E.

in Sri Venkateswara University College of Engineering,Tirupati.This Blog is about the Datastructures.The C++ Programming Code is GIven.It is under DevelopmentSoon We Will Finish and Improve Further.

Please Visit and Comment on it(This blog will appear in google search just type ‘codefords’)
……………..Thank you visit again





April 1, 2008


Data structures involve the organizing the data in different methods and performing the operations on these structures.

Datastructures are categorized as shown in fig:

Primitive Datastructures:
These are the datastructures which are directly supported by the machine.i.e.Any operation can be performed in these data items.
Eg:Integers,Real numbers,datatype involving characters

and some logical statements.

Non-primitive Datastructures:
These Datastructures do not allow any specific instructions to be performed on the Data items directly.
Eg: The set of Complex numbers

Linear Datastructures:
This DataStructures involve arranging the elements in Linear fashion.

Non-Linear Datastructures:
This Datastructures involve representing the elements in Hierarchical order.
Eg: Trees, Graphs



April 1, 2008


Linked list:

In order to store elements in the sequential
fashion we use Arrays. But they are fixed max
size,suppose if we want to use less memory than
that of fixed size then memory is wastaged, or
If we want to use more memory than that of fixed
size then deficiency of the memory will be the

In order to overcome all these type of problem
we use dynamically allocated memory ,which can
be allocated at run time called as node, so the
sequential arrangement of nodes are called linked

There are 2 types Single linkedlist and Double




April 1, 2008


Stack is nothing but a list of elements where insertion and deletion are possible at one end i.e. stack top.

It follows Last In First Out [LIFO] property.

Stacks are represented using Arrays and Linked lists.



April 1, 2008


Queue is also a list of elements with insertion is permitted at one end called rear end and deletion permitted at another end called front end.

It follows the property of First In First Out [FIFO].

Queues also implemented using Arrays and Linked




April 1, 2008


Definition of a Tree:

A tree is a set of one or more nodes T such that:
(i).There is a specially designated node called a root
(ii).The remaining nodes are partitioned into n disjointed
set of nodes T1, T2,…,Tn, each of which is a tree.

Degree of a Node of a Tree:
The degree of a node of a tree is the number of subtrees having this node as a root. In other words,the degree is the number of descendants of a node. If the degree is zero, it is called a terminal or leaf node of a tree.

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)

Level of a Node:
We define the level of the node by taking the level of the root node as 1, and incrementing it by 1 as we move from the root towards the subtrees.We then define the depth of the tree to be the maximum value of the level of the node of the tree.

Binary tree:
A tree T is finite set of nodes, such that
(i).T is empty(called Empty binary tree),
(ii).T contains specially designed node called the root
of T,and the remaining nodes of T form T1 and T2
which are called as left subtree and right subtree.

Binary Search Tree:
A Binary Tree is said to be Binary Search Tree, the values in the left subtree should be less than that of root element and the values in the right subtree should be greater than that of root element.

Tree Traversals:
Traversing is nothing but visiting all the nodes of a Tree exactly once.
In-order Traversal:
•visit left sub tree of the Root node using In-order traversal
•visit Root node
•visit right sub tree of the Root node using In-order traversal

Pre-order Traversal:
•visit Root node
•visit left sub tree of the Root node using Pre-order Traversal
•visit right sub tree of the Root node using Pre-order Traversal

Post-order Traversal:
•visit left sub tree of the Root node using Post-order Traversal
•visit right sub tree of the Root node using Post-order Traversal
•visit Root node