Nothing
Add <-
function(tree,string,node = 1) {
b <- tree
key <- str_sub(string,1,1)
if (is.na(b$ch[node])) {
b$ch[node] <- key
b$flag[node] <- 0
}
if (key < b$ch[node]) {
if (is.na(b$L[node])) {
b$L[node] <- length(b$ch) + 1
b <- Add(b,string,b$L[node])
}
else{
b <- Add(b,string,b$L[node])
}
}
else if (key > b$ch[node]) {
if (is.na(b$R[node])) {
b$R[node] <- length(b$ch) + 1
b <- Add(b,string,b$R[node])
}
else{
b <- Add(b,string,b$R[node])
}
}
else {
if (nchar(string) == 1) {
b$flag[node] <- 1
}
else {
if (!is.na(b$C[node]) || !is.na(b$L[node]) || !is.na(b$R[node])) {
if (is.na(b$C[node]) && (b$flag[node] == 1)) {
b$C[node] <- length(b$ch) + 1
b <- Add(b,str_sub(string,2,-1),b$C[node])
}
else if (is.na(b$C[node]) && (b$flag[node] == 0)) {
b$C[node] <- node + 1
b <- Add(b,str_sub(string,2,-1),b$C[node])
}
else{
b <- Add(b,str_sub(string,2,-1),b$C[node])
}
}
else{
b$C[node] <- length(b$ch) + 1
b <- Add(b,str_sub(string,2,-1),b$C[node])
}
}
}
return(b)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.