Skip to content

Commit

Permalink
feat: eseguibie
Browse files Browse the repository at this point in the history
  • Loading branch information
Wordluc committed May 1, 2024
1 parent fe24b75 commit 0a98451
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
Binary file added bin/FLanguage.exe
Binary file not shown.
19 changes: 19 additions & 0 deletions bin/Library/BinarySearch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Ff Run(array,value){
let low=0;
let high=len(array)-1;
let i=len(array)/2;
while (low<high){
if(array[i]==value){
ret i;
}

if(value>array[i]){
low=i+1;
}else{
high=i;
}
i=(high+low)/2;
}
ret -1;
}
END
44 changes: 44 additions & 0 deletions bin/Library/Tree.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Ff AddNode(value,node){
if(len(node)==0){
ret [[],value,[]];
}
if(value>node[1]){
node[2]=Tree_AddNode(value,node[2]);
}else{
node[0]=Tree_AddNode(value,node[0]);
}
ret node;
}

Ff MakeTree(list){
let i=1;
let node=[[],list[0],[]];
let ordered=newArray(len(list),0);
let v=0;
while(i<len(list)){
Tree_AddNode(list[i],node);
ordered[i]=v;
i=i+1;
}
ret node;
}
Ff interateTreeNodes(node,i,list){

if(len(node[0])!=0){
Tree_interateTreeNodes(node[0],i,list);
}
list[i[0]]=node[1];
i[0]=i[0]+1;

if(len(node[2])!=0){
Tree_interateTreeNodes(node[2],i,list);
}
}
Ff FromTreeToList(node,n){

let i=[0];
let list=newArray(n,0);
Tree_interateTreeNodes(node,i,list);
ret list;
}
END
4 changes: 4 additions & 0 deletions bin/Library/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
This is the standard library for FLanguage
*/
package Library

0 comments on commit 0a98451

Please sign in to comment.