Showing posts with label Data Structure Concept. Show all posts
Showing posts with label Data Structure Concept. Show all posts

Spanning Tree | Data Structure

 

Spanning tree of a graph G is a tree hold following properties:

1. Number of vertex in graph G = Number of vertex in spanning tree.

2. If n = Number of vertex in graph G than spanning tree has (n-1) edges.

3. Spanning tree does not have any cycle.

Example: 

Suppose G is any graph having four vertices {1,2,3,4}.

Interpolation Search | Data Structure



Logic of Interpolation Search

int Interpolation-search(int a[50],int low,int high,int s)

{

int mid;

if(low<=high)

{

mid=low+(high-low)*((s-a[low])/(a[high]-a[low]));

if(a[mid]==s)

{

return(mid);

}

Shall Sort | Data Structure

 




Logic of Shall sort

void shall-sort(int a[50],int n)

{

int d,temp,i,flag;

d=n/2;

while(d>=1)

{

Hashing & Collision Concept | Data Structure

Hashing :

Hashing is a search technique in which a specific function is used to store & retrieve data from memory this function is called hash function.

Deque or Double Ended Queue | Data Structure

 


Deque or Double Ended Queue:

In Deque or Double Ended Queue insertion and deletion takes place from any end of queue. We can insert or delete from rare (R) end and also from front (F) end.