Skip to content

Instantly share code, notes, and snippets.

View ksw2000's full-sized avatar
🪼
クラゲが好き

Kashiwa ksw2000

🪼
クラゲが好き
View GitHub Profile
@ksw2000
ksw2000 / find-min-and-max.c
Created April 17, 2024 09:51
NCKU-Algorithm-HW3-Solution
// gcc find-min-and-max.c -o find-min-and-max
// (gcc >= 12.3.0)
#include<stdio.h>
void findMinAndMax(const int* arr, int k, int* max, int* min){
*max = arr[k-1];
*min = arr[k-1];
for(int i = 1; i < k; i+=2){
if(arr[i] < arr[i-1]){
if(arr[i-1] > *max) *max = arr[i-1];
type AVLNode struct {
Key int
Val interface{}
left *AVLNode
right *AVLNode
height int
}
func NewAVLNode(key int, val interface{}) *AVLNode {
return &AVLNode{
#include <stdio.h>
const int global_x = 1; // data (read only)
int global_y = 1; // data
int global_z; // bss
int main() {
const static int x = 1; // data (read only)
static int y = 1; // data
static int z; // bss
int w = 1; // stack
@ksw2000
ksw2000 / 00-bst-adt.go
Last active August 22, 2023 17:11
The example of binary search tree
type BSTNode struct {
Key int
Val interface{}
left *BSTNode
right *BSTNode
}
type BST struct {
root *BSTNode
}
class ResBlock(keras.Model):
def __init__():
super().__init__()
# filters: 64, kernel_size: 3, stride: 1
self.conv1 = layers.Conv2D(64, 3, 1, padding='same')
self.conv2 = layers.Conv2D(64, 3, 1, padding='same')
self.shortcut = keras.Sequential()
def call(self, input):
shortcut = self.shortcut(input)
input = self.conv1(input)
#include <stdio.h>
int main() {
char* map[] = {"", "Ayumu", "Honoka", "Chika"};
printf("1->%s\n", map[1]);
printf("2->%s\n", map[2]);
printf("3->%s\n", map[3]);
return 0;
}