Skip to content

Instantly share code, notes, and snippets.

View atoye1's full-sized avatar
😆
Happy Coding!

Donghun Seol atoye1

😆
Happy Coding!
View GitHub Profile
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.17;
interface ERC20Interface {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address spender, address recipient, uint256 amount) external returns (bool);
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.17;
interface ERC20Interface {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address spender, address recipient, uint256 amount) external returns (bool);
@atoye1
atoye1 / binary_searchs.py
Created June 9, 2022 00:22
코딩테스트_이진탐색
def binary_search(arr, start, end, val):
if start > end:
return -1
mid = (start + end) // 2
if arr[mid] == val:
return mid
elif arr[mid] > val:
return binary_search(arr, start, mid - 1, val)
elif arr[mid] < val:
return binary_search(arr, mid + 1, end, val)
typedef struct {
int heap[MAX_DATA];
int heap_size;
} HeapType;
int deleteHeap(HeapType *h){
int parent, child;
int item, temp;
item = h->heap[0];
struct node{
struct node* left;
struct node* right;
int data;
}
struct node *tree_ptr;
void preorder(struct node* tree_ptr){
if (tree_ptr) {
typedef struct ListNode{
struct ListNode* Llink;
int data[10];
struct ListNode* Rlink;
} listNode;
typedef struct {
listNode *Rhead;
listNode *Lhead;
} linkedList_h;
void addNode(linkedList_h*, int x){
listNode* NewNode;
listNode* LastNode;
NewNode = (linkedList_h*)malloc(sizeof(linkedList_h));
NewNode->data = x;
NewNode->link = NULL;
if (H->head == NULL){
H->head = NewNode;
NewNode->link = NULL;
@atoye1
atoye1 / linked_list.c
Last active December 13, 2021 14:42
KNOU LinkedList Implementation
typedef struct ListNode{
int data[10];
struct ListNode* link;
} listNode;
typedef struct{
listNode* head;
} linkedList_h;
linkedList_h* createLinkedList_h(void){
@atoye1
atoye1 / test.c
Created December 13, 2021 14:04
gist test code
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
}