Preview

Frequent Subtree Mining Algorithm

Satisfactory Essays
Open Document
Open Document
488 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Frequent Subtree Mining Algorithm
// FREQUENT SUBTREE MINING ALGORITHM...

#include
#include
#include
#include
#include
#include

using namespace std;

FILE *fp; int no_of_nodes=0, string_ctr=0, vect_ctr=0, vect_ctr1=0,pos_ctr=0,*pos;

struct MyNode
{
string name; vector children;
}*myroot, *myroot1, **tree_pattern, **subtree_pattern;

//FUNCTION PROTOTYPES DECLARATION ... static void print_element_names(xmlNode *); static MyNode* preprocess(xmlNode *,MyNode *, int); int printMyNode(MyNode *); void print(MyNode **, int); void print_pos_array(int *,int); int check_child(MyNode *, MyNode *);

int main() { xmlDoc *doc = NULL; xmlDoc *doc1 = NULL; xmlNode *root_element = NULL; xmlNode *root_element1 = NULL; const char *pattern = "/home/naveen/Desktop/SubTrees_in_Tree/Programs/pattern.xml"; const char *subpattern = "/home/naveen/Desktop/SubTrees_in_Tree/Programs/subpattern.xml";

doc = xmlReadFile(pattern, NULL, 0); doc1 = xmlReadFile(subpattern, NULL, 0);

if (doc == NULL || doc1 == NULL) printf("error: could not parse file %s or %s.\n", pattern,subpattern); else { fp = fopen("input_file.txt","w");

// For Getting The Root Element Node ... root_element = xmlDocGetRootElement(doc); print_element_names(root_element); printf("The Total Number Of Nodes In The Tree : %d \n",no_of_nodes); fprintf(fp,"\n");

tree_pattern = (struct MyNode **)malloc(no_of_nodes*sizeof(struct MyNode *)); pos = (int *)malloc(no_of_nodes*sizeof(int));

no_of_nodes = 0; root_element1 = xmlDocGetRootElement(doc1); print_element_names(root_element1); printf("The Total Number Of Nodes In The SubTree : %d\n",no_of_nodes);

int n = no_of_nodes; subtree_pattern = (struct

You May Also Find These Documents Helpful

  • Powerful Essays

    [4] Storage Conference. The Hadoop Distributed File System http://storageconference.org/ 2010/ Papers/ MSST/Shvachko.pdf [5] A Tutorial on Clustering Algorithms. K-Means Clustering http://home.dei.polimi.it/matteucc/ Clustering/ tutorial_html/kmeans.html [6] International Journal of Computer Science Issues. Setting up of an Open Source based Private Cloud http://ijcsi.org/papers/IJCSI-8-3-1-354-359.pdf [7] Eucalyptus. Modifying a prepackaged image http://open.eucalyptus.com/participate/wiki/modifyi ng-prepackaged-image [8] Michael G. Noll. Running Hadoop On Ubuntu Linux (Single-Node Cluster) http://www.michaelnoll.com/tutorials/running-hadoop-on-ubuntu-linuxsingle-node-cluster/ [9] 8K Miles Cloud Solutions. Hadoop: CDH3 – Cluster (Fully-Distributed) Setup http://cloudblog.8kmiles.com/2011/12/08/hadoopcdh3-cluster-fully-distributed-setup/ [10] Apache Mahout. Creating Vectors from Text https://cwiki.apache.org/MAHOUT/creatingvectors-from-text.html…

    • 3006 Words
    • 13 Pages
    Powerful Essays
  • Powerful Essays

    Classification Solution in order for you to get the high ratings in ones very own research paper.…

    • 1414 Words
    • 9 Pages
    Powerful Essays
  • Satisfactory Essays

    A Smart Cookie Analysis

    • 302 Words
    • 2 Pages

    What are the obstacles to the American dream? Well some common obstacles is lack of education, money, and work opportunities. Those obstacles which are education, money, and work opportunities can stop your American Dream.…

    • 302 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Predict ‘kicks’ or bad purchases using Carvana – Cleaned and Sampled.jmp file. Create a validation data set with 50% of the data. Use Decision Tree, Regression and Neural Network approached for building predictive models. Perform a comparative analysis of the three competing models on validation data set. Write down your final conclusions on which model performs the best, what is the best cut-off to use, and what is the ‘value-added’ from conducting predictive modeling? Upload the saved file with the assignment.…

    • 376 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    I. To find if there is any root to leaf path with specified sum in a binary tree.…

    • 359 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Incremental Analysis

    • 1252 Words
    • 6 Pages

    What is Incremental Analysis? Basically, it’s a managerial decision making process. Decisions are a huge part of being a manager. Decision making does not always involve lots of people and a set schedule, but decisions vary in their complexities and some involve a little research to see if they will work out. There are four steps to incremental analysis. They are very simple: 1.Identify the problem, 2.Determine and evaluate possible courses of action, 3.Make a decision, and 4.Review results of the decision. We, as the accountants, contribute the most to steps 2 and 4. In step 2, we provide relevant data and cost data. These show the expected outcome of the effect on net income. In step 4, we read the internal reports that are the results of the review.…

    • 1252 Words
    • 6 Pages
    Powerful Essays
  • Better Essays

    Hierarchical and relational databases are two different manners in which to store and organize data that also allow management and utilization of that data. There are essential aspects that any database should be able to provide, those of creating, reading, updating and deleting data. Upon becoming familiar with how each database is set up, it is important to look at the advantages and disadvantages of each model in determining which type of database one would want to utilize.…

    • 1249 Words
    • 5 Pages
    Better Essays
  • Good Essays

    Doubly Linklist

    • 555 Words
    • 3 Pages

    #include<stdio.h> #include<conio.h> #include<alloc.h> typedef struct dll { int data; struct dll *next; struct dll *prev; }node; //struct dll *head= NULL; node *getnode() { node *temp; temp=(node *)malloc(sizeof(node)); temp->next= NULL; temp->prev=NULL; return temp; } node *creation() { node *temp,*new1,*head; int f=1; char c; do { new1=getnode(); printf("\n\nEnter the data.\n\n"); scanf("%d",&new1->data); if(f==1) { head=new1; temp=head; f=0; } else { temp->next=new1; new1->prev=temp; temp=new1; } printf("\n\nDo you want to continue with creation.\n\n"); c=getche(); }while(c=='y'||c=='Y'); return head; } void display(node *head) { node *temp; temp=head; printf("\n\nThe list is...\n\n"); while(temp!=NULL) { printf("%d\n",temp->data); temp=temp->next; } } node *insertion(node *head) { node *new1,*temp; int c,value; char ch; do { new1=getnode(); printf("\n\nEnter the data to be insered.\n\n"); scanf("%d",&new1->data); printf("\n\nEnter your place of insertion.\n\n"); printf("\n1.Head.\n2.Intermediate.\n3.Tail.\n"); scanf("%d",&c); switch(c) { case 1: temp=head; new1->next=temp; temp->prev=new1; head=new1; break; case 2: temp=head; printf("\n\nEnter the value after which the insertion has to take place.\n\n"); scanf("%d",&value); while(temp->data!=value) { temp=temp->next; } temp->next->prev=new1; new1->next=temp->next; temp->next=new1; new1->prev=temp; break; case 3: temp=head; while(temp->next!=NULL) { temp=temp->next; } temp->next= new1; new1->next=…

    • 555 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    of Computer Science and Engineering Pennsylvania State University, University Park Email: {xji, zha, metzner}@cse.psu.edu † Department of Electrical Engineering Pennsylvania State University, University Park Email: kesidis@engr.psu.edu leads to large amount of information delivery. In general, the cost for computation locally is much lower than that for communication for a sensor. In order to prolong the life of a wireless sensor network, it is desirable to minimize the communication costs in operating the sensor network. The continuous objects can be some poison gas or biochemical materials, which are released maliciously from some specific source and then slowly diffuse. Although they are usually in three dimension space in reality, it is generally more interesting to know their locations and spread in a two dimension plane of the earth’s surface. Figure 1 (a) illustrates the detection and tracking of three continuous objects. Sensors around the objects detect and track their boundaries and send the boundary information to the sink in hop-by-hop fashion along the dashed lines. Then, the sink relies the boundary information to outside computers or the Internet. The most efficient manner to identify the existence of the objects is to probe their boundaries. The boundary of a continuous object is consecutive and enclosing the continuous object, inside which the content of the target material per unit region is nearly homogeneous and higher than a threshold. We hope to find portion of objects’ boundaries that are inside the area with sensors deployed. Current signal processing techniques enable sensors to precisely detect the content of target material at their nearby region. However, it is desirable to propose some infrastructure to facilitate sensor collaboration. The continuous objects…

    • 4287 Words
    • 18 Pages
    Powerful Essays
  • Powerful Essays

    Database management systems (DBMSs) have largely ignored the task of managing the energy consumed during query processing. Both economic and environmental factors now require that DBMSs pay close attention to energy consumption. In this paper we approach this issue by considering energy consumption as a first-class performance goal for query processing in a DBMS. We present two concrete techniques that can be used by a DBMS to directly manage the energy consumption. Both techniques trade energy consumption for performance. The first technique, called PVC, leverages the ability of modern processors to execute at lower processor voltage and frequency. The second technique, called QED, uses query aggregation to leverage common components of queries in a workload. Using experiments run on a commercial DBMS and MySQL, we show that PVC can reduce the processor energy consumption by 49% of the original consumption while increasing the response time by only 3%. On MySQL, PVC can reduce energy consumption by 20% with a response time penalty of only 6%. For simple selection queries with no predicate over-lap, we show that QED can be used to gracefully trade response time for energy, reducing energy consumption by 54% for a 43% increase in average response time. In this paper we also highlight some research issues in the emerging area of energy-efficient data processing.…

    • 1814 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    A Red

    • 767 Words
    • 4 Pages

    A red–black tree is similar in structure to a B-tree of order[note 1] 4, where each node can contain between 1 to 3 values and (accordingly) between 2 to 4 child pointers. In such B-tree, each node will contain only one value matching the value in a black node of the red–black tree, with an optional value before and/or after it in the same node, both matching an equivalent red node of the red–black tree.…

    • 767 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Most computers are used for data processing, as a big growth area in the “information age”…

    • 326 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    knowledge discovery process approach on these data. Now-aday a new research community, educational data mining…

    • 2994 Words
    • 14 Pages
    Powerful Essays
  • Satisfactory Essays

    personal

    • 337 Words
    • 2 Pages

    Chat Application in PHP chat.zip chat.html chat_recv_ajax.php chat_send_ajax.php dbconnect.php 1 2 3 4 Untitled Page 5 6 7 8 var t = setInterval(function(){get_chat_msg()},5000); 9 10 11 // 12 // General Ajax Call 13 // 14 15 var oxmlHttp; 16 var oxmlHttpSend; 17 18 function get_chat_msg() 19 { 20 21 if(typeof XMLHttpRequest !…

    • 337 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    RDBMS

    • 622 Words
    • 3 Pages

    A data model is a collection of high-level data description constructs that hide many low-level storage details…

    • 622 Words
    • 3 Pages
    Satisfactory Essays