This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef int data; | |
typedef struct arv { | |
struct arv *left; | |
struct arv *right; | |
data value; | |
} Arvore; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include "arv.h" | |
void initialize(Arvore **arv) { | |
*arv = NULL; | |
} | |
int empty(Arvore *arv) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Funcionario(id_departamento, id_geren) = se relaciona com departamento (é o lado 1), se relaciona com ele mesmo (auto relação) | |
-> relação funcionario-ALOCADO-depatamento | |
Departamento(id_geren) = se relaciona com funcionario (é o lado 1), pois um gerente pode se relacionar com mais de um departamento | |
-> relação funcionado-GERENCIA-departamento | |
Dependente(id_funcionario) = se relaciona com funcionario, funcionário é o lado 1, dependente é o lado N, porque um funcionario pode ter varios dependentes porem um dependente so pode ser de um unico funcionario | |
-> relação funcionario-POSSUI-dependente | |
--------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" id="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no"> | |
<script src="json2.js" type="text/javascript"></script> | |
<script src="phonegap.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
// invoked when device is ready |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from flask import Flask | |
app = Flask(__name__) | |
# Index | |
@app.route("/") | |
def index(): | |
return "Estamos na página principal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sdcard = navigator.getDeviceStorage("sdcard"); | |
var file = new Blob(["This is a text file."], {type: "text/plain"}); | |
var request = sdcard.addNamed(file, "my-file.txt"); | |
request.onsuccess = function () { | |
var name = this.result; | |
console.log('File "' + name + '" successfully wrote on the sdcard storage area'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sdcard = navigator.getDeviceStorage('sdcard'); | |
var request = sdcard.get("my-file.txt"); | |
request.onsuccess = function () { | |
var file = this.result; | |
console.log("Get the file: " + file.name); | |
} | |
request.onerror = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arvore* remove_node(Arvore *arv, int d) { | |
if (arv == NULL) return NULL; | |
if (arv->dado > d) { | |
arv->esquerda = remove_node(arv->esquerda, d); | |
} else if (arv->dado < d) { | |
arv->direita = remove_node(arv->direita, d); | |
} else { | |
if (arv->esquerda == NULL && arv->direita == NULL) { | |
free(arv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No* buscar(No *lista, int valor) { | |
No *aux; | |
aux = lista; | |
if (aux == NULL) return NULL; | |
if (aux->dado == valor) return lista; | |
else return buscar(aux->proximo, valor); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct no { | |
int dado; | |
struct no *proximo; | |
} No; | |
typedef struct desc { | |
No *primeiro; |