This file contains 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
// 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); |
This file contains 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
// 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); |
This file contains 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
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) |
This file contains 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
typedef struct { | |
int heap[MAX_DATA]; | |
int heap_size; | |
} HeapType; | |
int deleteHeap(HeapType *h){ | |
int parent, child; | |
int item, temp; | |
item = h->heap[0]; |
This file contains 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
struct node{ | |
struct node* left; | |
struct node* right; | |
int data; | |
} | |
struct node *tree_ptr; | |
void preorder(struct node* tree_ptr){ | |
if (tree_ptr) { |
This file contains 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
typedef struct ListNode{ | |
struct ListNode* Llink; | |
int data[10]; | |
struct ListNode* Rlink; | |
} listNode; | |
typedef struct { | |
listNode *Rhead; | |
listNode *Lhead; | |
} linkedList_h; |
This file contains 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
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; |
This file contains 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
typedef struct ListNode{ | |
int data[10]; | |
struct ListNode* link; | |
} listNode; | |
typedef struct{ | |
listNode* head; | |
} linkedList_h; | |
linkedList_h* createLinkedList_h(void){ |
This file contains 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> | |
int main(){ | |
printf("Hello World!\n"); | |
return 0; | |
} |