Skip to content

Instantly share code, notes, and snippets.

View giovannamoeller's full-sized avatar

Giovanna Moeller giovannamoeller

View GitHub Profile
//
// KeychainHelper.swift
// VollMed
//
// Created by Giovanna Moeller on 28/08/23.
//
import Foundation
import Security
@giovannamoeller
giovannamoeller / index.js
Created January 22, 2023 01:09
projeto de implementação de sistemas
const axios = require('axios')
const apiKey = '4c9fecf589d34837a7e92b5fc42b6062'
const usuarios = []
const linhas = []
const todosOnibus = []
class Autenticacao {
constructor() {}
static login(email, senha) {
class ListNode {
constructor(value) {
this.value = value
this.next = null
}
}
class LinkedList {
head = null
tail = null
function linearSearch(array, target) {
let index = -1
let count = 0
for(let i = 0; i < array.length; i++) {
count++
if (array[i] == target) {
console.log(`A busca linear levou ${count} etapas`)
index = i
}
}
@giovannamoeller
giovannamoeller / bigO.js
Created November 22, 2022 13:05
Big O - Example with JS
function mesurePerformance(func, array) {
const startTime = performance.now()
func(array)
const endTime = performance.now()
console.log(`Tempo de execução: ${endTime - startTime} milisegundos`)
}
function func1(array) {
return 1 + array[0]
}
@giovannamoeller
giovannamoeller / binary-search.cpp
Created October 26, 2022 22:48
binary search vs linear search
//
// main.cpp
// Run Folder
//
// Created by Giovanna Moeller on 03/10/22.
//
#include <iostream>
#include <vector>
const student = {
name: 'John',
age: 16,
averageGrade: 8
}
function addOneToStudentGrade(student) {
return { ...student, averageGrade: student.averageGrade + 1}
}
const student = {
name: 'John',
age: 16,
averageGrade: 8
}
function addOneToStudentGrade(student) {
student.averageGrade += 1;
return student;
}
class Person {
constructor(name, height, weight, age) {
this.name = name;
this.height = height;
this.weight = weight;
this.age = age;
}
getAge() {
return this.age;
const array = [1, 2, 3, 4];
function getDoubledArray(array) {
const arrayDoubled = [];
for (let i = 0; i < array.length; i++) {
const doubleValue = getDoubledValue(array[i])
arrayDoubled.push(doubleValue);
}
return arrayDoubled
}