Skip to content

Instantly share code, notes, and snippets.

View ctj01's full-sized avatar

Cristian Mendoza ctj01

View GitHub Profile
@ctj01
ctj01 / trie.js
Last active September 25, 2024 19:43
Trie
import React, { useState, useEffect } from 'react';
import data from './movies/movies_batch_0.json';
class Trie {
constructor() {
this.root = {};
}
insert(word) {
let node = this.root;
## common functions
def add(i,j):
return i + j
a = add(5,4);
print(a)
##lambda expressions
a = lambda x , y : x + y
##s = sorted(x, key = lambda x:x[-2:])
##print(s)
x = [
"shoat",
"tubal",
"eclat",
"olam",
"stat",
l = [1 , 26, 9]
iterator = iter(l);
print(iterator.__next__())
#1
""" muteable object """
l = [1 , 26, 9]
l[2] = 8
print(l)
#output
#[1, 26, 8]
x = [
"shoat",
"tubal",
"eclat",
"olam",
"stat",
"gnar",
"babai",
"scoad",
"scrap"
x = [
"shoat",
"tubal",
"eclat",
"olam",
"stat",
"gnar",
"babai",
"scoad",
"scrap"
public delegate void CallBackTareaCompletada(string mensaje);
class Program
{
static void Main(string[] args)
{
CalllingCallback callback = new CalllingCallback();
callback.Tarea("soy la tarea inicial");
callback.Call();
}
@ctj01
ctj01 / program.cs
Last active January 24, 2021 00:32
class Program
{
public delegate int MyPrimerDelegado(int a, int b);
static void Main(string[] args)
{
MyPrimerDelegado del = Operaciones.Suma; // referenciando al metodo suma de la clase operaciones
int suma = del(6, 8);
del = Operaciones.Resta;// referenciando al metodo resta de clase operaciones
int resta = del(5, 2);
const isYourFriendHappy = true;
const willGoingHisHome = new Promise((resolve, reject) => {
if(isYourFriendHappy)
{
const goodDay = {
games: 'enjoy good food'
}