Skip to content

Instantly share code, notes, and snippets.

View ahlixinjie's full-sized avatar
💭
🫥

小新 ahlixinjie

💭
🫥
View GitHub Profile
#include "cachelab.h"
#include <unistd.h>
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include "csim.h"
#include <stdlib.h>
int tBit = 0, sBit = 0, bBit = 0;
struct params args;
@ahlixinjie
ahlixinjie / createBinTree.java
Last active February 4, 2020 18:18
构建二叉树
public static <R> R buildTreeByStrings2(Integer[] input, Class<R> clazz) {//R为结点类型
if (input == null || input.length == 0) return null;
Method getLeft = null;
Method getRight = null;
Method setLeft = null;
Method setRight = null;
try {//一定得有这几个方法
getLeft = clazz.getMethod("getLeft");
getRight = clazz.getMethod("getRight");
setLeft = clazz.getMethod("setLeft",clazz);