- 博客(62)
- 资源 (385)
- 问答 (103)
- 收藏
- 关注
原创 Do a breadth first traversal of a tree
import java.util.LinkedList;import java.util.Queue;import java.util.concurrent.ConcurrentLinkedQueue;class BinaryTree { static class Node { char data; Node left = null; Node right = n
2012-08-31 17:10:20 689
原创 Write a function to find the depth of a binary tree
class BinaryTree { static class Node { char data; Node left=null; Node right=null; int i; } public static char[] dataArray = new char[] { 'a', 'b', 'c','d','e' ,'f','g','h','i','j','
2012-08-31 15:31:15 588
原创 java 二叉树创建
class BinaryTree { static class Node { char data; Node left; Node right; int i; } public static char[] dataArray = new char[] { 'a', 'b', ' ', 'd' }; public static Node creatRoot(N
2012-08-31 13:55:11 695
原创 Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if
Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list).
2012-08-30 17:19:38 764
原创 Write a program to remove duplicates from a sorted array.
import java.util.Arrays;public class Duplicate { public static void main(String args[]) { int[] array = new int[20]; int[] newArray = new int[10]; for (int i = 0; i array[i] = (int)
2012-08-30 16:52:25 773
原创 Given an array of characters. How would you reverse it.
public class Reverse { public static void main(String args[]) { StringBuilder array = new StringBuilder(); array.append("abcderr"); for(int i=0;i { char temp=array.charAt(i);
2012-08-30 15:43:22 523
原创 Given an array t[100] which contains numbers between 1..99. Return the duplicated value
Given an array t[100] which contains numbers between 1..99. Return the duplicated value import java.util.HashSet;import java.util.Set;public class Duplica
2012-08-30 15:05:30 1118
原创 Write efficient code for extracting unique elements from a sorted list of array. e.g.
Write, efficient code for extracting unique elements from a sorted list of array. e.g.(1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9). public class Unique { public static void mai
2012-08-30 11:37:28 1170
转载 HashMap和Hashtable的区别 ;String StringBuffer StringBuilder 三者的区别
Hashtable中元素的"键"和"值"均不允许为null,HashMap则允许;Hashtable是线程安全的一个Collection,HashMap不是线程安全的;Hashtable继承自Dictionary,HashMap继承自AbstractMap String 字符串常量StringBuffer 字符串变量(线程安全)StringBuilder 字符串
2012-08-30 11:26:52 703
转载 strcpy的实现
char *strcpy(char *strDestination, const char *strSource) { assert(strDestination!=NULL && strSource!=NULL); char *strD=strDestination; while ((*strDestination++=*strSource++)!='\0
2012-08-30 09:57:24 498
原创 java 快速排序
import java.util.Comparator;import java.util.Random; public class QuickSort { public static final Random RND = new Random(); private static void swap(Object[] array, int i, int
2012-08-29 18:32:53 561 1
原创 java 堆排序
public class HeapSortClass { final static int HEAP_SIZE = 13; //堆積樹大小 /*父結點*/ public static int parent(int i) { return (int)Math.floor(i / 2); } /*左子結點*/ public stat
2012-08-29 17:33:39 706 1
原创 遍历d盘输出d盘.txt的文件名
import java.io.File;import java.util.ArrayList;import java.util.List;public class FileTraversal { public static void main(String... _) { String path = "D:/"; List data = new ArrayList();
2012-08-29 16:45:02 2231
原创 在有序表R[0..n-1]中进行二分查找,成功时返回结点的位置,失败时返回-1
public class DivideSearch {public static void main(String args[]){ int[] data=new int[13]; for(int i=0;i { data[i]=i; } data[10]=12; data[11]=14; data[12]=16; System.out.print(
2012-08-29 15:32:04 3356
原创 编写一个函数用于去除字符串中多余的空格,,
编写一个函数用于去除字符串中多余的空格,比如字符串"a b c",处理后为"a b c" public class StringManipulation { public static void main(String args[]) { String a="a d b c"; String b=" ";
2012-08-29 14:27:13 4850 2
原创 笔试题
a[3][4]哪个不能表示 a[1][1]: *(&a[0][0]+5) *(*(a+1)+1) *(&a[1]+1) *(&a[0][0]+4)答案: *(&a[1]+1)a是数组的首地址,a[1]就表示a[1][0]地址了,不用再取地址了。 顺序查找的平均时间答案:(1+2+3+…+n)/n = (n+1)/2for(i=0,sum=0; i答案:sum = 5
2012-08-29 10:30:11 832
原创 android 遍历安装过的包名
pageManage = getPackageManager();List packages = pageManage.getInstalledPackages(0); for(int i=0;iPackageInfo packageInfo = packages.get(i); String appName = packageInfo.applicationInf
2012-08-24 17:04:44 2788 1
原创 Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted. public class StringManipulat
2012-08-24 14:23:46 985
原创 Insert in a sorted list
public class OneLinkNode { public int data; public OneLinkNode next; public OneLinkNode(int k) { data = k; next = null; } public OneLinkNode() { this(0); } public static void ma
2012-08-23 17:52:00 671
原创 Reverse a linked list.
public class OneLinkNode { public int data; public OneLinkNode next; public OneLinkNode(int k) { data = k; next = null; } public OneLinkNode() { this(0); } public static void ma
2012-08-23 17:41:37 499
原创 Java Swap函数
class ABC{int abc;}public class Swap {public static void main(String args[]){ABC a1=new ABC();ABC a2=new ABC();a1.abc=111;a2.abc=222;System.out.println("a.abc:"+a1.abc+" b.abc:"+a2.a
2012-08-23 17:40:30 1167
原创 Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.
Give a very good method to count the number of ones in a "n" (e.g. 32) bit number. public class Count { public static void main(String args[]) { int count=0; int n
2012-08-23 11:37:31 1666
原创 Given an array of characters which form a sentence of words, give an efficient algorithm to reverse
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. import java.util.Ar
2012-08-23 11:12:21 744
原创 You’re given an array containing both positive and negative integers and required to find the sub-a
You’re given an array containing both positive and negative integers and required to find the sub-array with the largest sum import java.util.ArrayList;import java.util.List;
2012-08-22 19:01:24 1063
原创 Given an array of size N in which every number is between 1 and N, determine if there are any dupli
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. import java.util.Arrays;import java.util.HashSet;import java.util.Se
2012-08-22 18:07:06 1875
原创 题目:对一批编号为1-100全部开关朝上(开)的灯进行以下操作:
题目:对一批编号为1-100全部开关朝上(开)的灯进行以下操作:开关编号凡是1的倍数反方向拨一次开关;若该编号也是2的倍数反方向又拨一次开关;若该编号又是3的倍数反方向又拨一次开关……以此类推一直计算到100为止。目的:请trace出经过反复开关操作后所有关闭的灯的开关编号。public class Light {public static void setBack(int[]
2012-08-22 16:37:15 14838
原创 将9个石子放在9x9的方格中,要求同行、同列、45度上无两个石子。
public class Nine { public static int create08() { int l = (int) (Math.random() * 10) - 1; if (l l = 0; return l; } public static void main(String args[]) { int[][] map = new in
2012-08-22 12:01:57 2273
原创 android progressBar 背景改变
//progress_horizontal.xmlhttp://schemas.android.com/apk/res/android" > android:startColor="#ffa4cf2f"
2012-08-21 18:20:38 2297
原创 android 滑动欢迎界面
import java.util.ArrayList;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Parcelable;import android.support.v4.view.PagerAdapter;impor
2012-08-21 15:55:18 3127 1
原创 listview使用注意
@Override public View getView(final int position, View convertView, ViewGroup parent) { View v = null; if (convertView == null) { v = MainActivity.this.getLayoutInflater().inflate
2012-08-20 10:31:00 782
原创 龙的传人DIY.lua
给小村的木桩添加事件SetD(70,65,2,事件编号) 显示百事通的事件编号QZXS(GetD(70,81,2).."") 显示一个NPC的贴图QZXS(GetD(56,3,5).."") 给小村加一个NPC的贴图SetS(70,18,28,1,6092)
2012-08-19 19:59:00 1480 2
原创 连接两个单向链表,返回排序后的结果。
import java.util.Arrays;public class OneLinkNode { public int data; public OneLinkNode next; public OneLinkNode(int k) { data = k; next = null; } public OneLinkNode() { this(0);
2012-08-18 21:38:53 883
原创 android重写Dialog(接上文)
//dialog.xml http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" >
2012-08-17 15:11:22 3132
原创 Android客户端优化
1切换界面卡。2滑动列表卡。3用户触发事件卡。 针对1.3,你只要把握以下几点:1.异步加载(画在主thread中,准备数据在工作thread中)2.分线程做事3.避免遍历或者使用耗时很长的api(尽量用效率高的api替代)4.缓存机制 耗时操作列举:IO/SQL(不稳定时间开销)ListFile(消耗大量时间)Infla
2012-08-17 09:44:25 825
原创 Base64_EXT.java
/** * * Encodes and decodes to and from Base64 notation. * * * Homepage: http://iharder.net/base64http://iharder.net/base64">http://iharder.net/base64>. * * * * Example: *
2012-08-15 12:47:19 2245 1
原创 一个保存有10000个URL的文本文件,删除其中相同的URL。
import java.util.HashSet;import java.util.Iterator;import java.util.Set;public class DeleteSame { public static void main(String args[]) { Set s = new HashSet(); for (int i = 0; i s
2012-08-13 21:28:52 1980
原创 笔试题
1.进程间通讯的方式?1)文件和记录锁定Unix中为避免两个进程同时访问同一共享资源而引起混乱,在进程对共享资源进行访问前对其锁定,该进程访问完后再释放2)管道一个进程创建一个管道,并调用fork创建一个子进程,父进程关闭读管道端,子进程关闭写管道端3)FIFOFIFO是一种先进先出的队列,它类似于一个管道,只允许数据单向流动,每个FIFO都有一个名字,允许不相关的进程访问
2012-08-12 16:35:36 817
原创 Java 时间
private synchronized static String getTransFileDateTime() { try { Thread.sleep(1); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
2012-08-09 11:32:11 496
原创 public static String getProcessName(Context context) {
public static String getProcessName(Context context) { ActivityManager actMgr = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List appList = actMgr.getRunningAppProcesses
2012-08-08 11:19:26 1822
huggingface.co/Salesforce/blip-image-captioning-base
2024-08-22
Qwen2-7B 的 model-00004-of-00004.safetensors 的2/2
2024-07-29
Qwen2-7B 的 model-00004-of-00004.safetensors 的1/2
2024-07-29
Qwen2-7B 的 model-00003-of-00004.safetensors 的2/2
2024-07-29
Qwen2-7B 的 model-00003-of-00004.safetensors 的1/2
2024-07-29
Qwen2-7B 的 model-00002-of-00004.safetensors 的2/2
2024-07-28
Qwen2-7B 的 model-00002-of-00004.safetensors 的1/2
2024-07-28
Qwen2-7B 的 model-00001-of-00004.safetensors 的2/2
2024-07-28
Qwen2-7B 的 model-00001-of-00004.safetensors 的1/2
2024-07-28
Qwen2-7B-Instruct 的 model-00004-of-00004.safetensors 的2/2
2024-07-26
Qwen2-7B-Instruct 的 model-00004-of-00004.safetensors 的1/2
2024-07-26
Qwen2-7B-Instruct 的 model-00003-of-00004.safetensors 的2/2
2024-07-26
Qwen2-7B-Instruct 的 model-00003-of-00004.safetensors 的1/2
2024-07-26
Qwen2-7B-Instruct 的 model-00002-of-00004.safetensors 的2/2
2024-07-26
Qwen2-7B-Instruct 的 model-00002-of-00004.safetensors 的1/2
2024-07-26
Qwen2-7B-Instruct 的 model-00001-of-00004.safetensors 的2/2
2024-07-25
Qwen2-7B-Instruct 的 model-00001-of-00004.safetensors 的1/2
2024-07-25
torch-2.3.0+cu118-cp38-cp38-linux-x86-64.whl
2024-06-24
meta-llama-3-8b-instruct 的 model-00004-of-00004.safetensors
2024-05-29
meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的3/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的2/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的1/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的3/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的2/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的1/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00001-of-00004.safetensors 的3/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00001-of-00004.safetensors 的2/3
2024-05-29
meta-llama-3-8b-instruct 的 model-00001-of-00004.safetensors 的1/3
2024-05-29
huggingface的bert-base-chinese
2024-03-05
huggingface的bert-base-uncased
2024-03-03
自动驾驶,如何得到方向盘转动的ground truth?
2024-03-18
AlphaGo能超越人类,因为训练时 对于模型的每个输入,都有一个100%正确的答案?
2024-01-16
其实LLM/ChatGPT是否在距离AlphaGo式AI越来越远?
2024-01-16
技术上,ChatGPT要成为 AI医生/AI律师/AI教师 还欠缺哪些能力?
2024-01-11
数学 是且仅是 一种语言和一种工具,不是科学的全部?
2023-12-14
哪些时候用CUDA编程更好?
2023-12-14
用RL做NLP,和 根据那条数据的reward重新标注那条数据 有什么区别?
2022-05-07
没有物理机器人载体,如何在模拟环境里的进行学习和研究机器人?
2022-04-28
2022年了,USB式GPU有哪些进展?
2022-04-28
2022年了,有哪些稳压deepfm的CTR模型?
2022-04-01
CTR模型,如果上线了没效果,这时可以进行哪些分析工作?以及有无必要投入大量时间分析?
2022-03-24
算法工程师如何应对做算法策略的不确定性;比如没效果,这时绩效怎么保证?
2022-03-01
CTR模型必须要有一个测试数据集吗? 训练数据集和测试数据集是同一个,可以吗?
2022-02-25
为啥我感觉现在机器学习模型就是一种模糊匹配工具or相似识别工具?
2022-02-16
因果推断技术靠谱吗,感觉里面的影响因素太多了,所以能实际解决落地问题吗?
2022-02-08
XGB/GBDT/决策树,得出特征重要性的原理是什么?
2022-02-08
强化学习是不是无人驾驶的未来?
2022-02-01
GAN生成图像,弄一个discriminator ,和无D直接生成,区别是?
2022-02-01
哪些互联网公司的管理职级和专业职级是分开的?
2022-01-22
CTR模型的AUC如果比较高,是否其实只是 因为复购行为带来的AUC虚高?
2022-01-17
CTR模型的本质是不是算出 user的哪些特征和item的哪些特征 最匹配?
2022-01-08
人工智能的因果学习(Causal Learning)到底想解决什么问题?
2021-12-17
BYOL里stop-gradient的作用是什么?
2021-12-01
马上2022年了,强化学习+NLP 有了哪些突破?
2021-11-26
马上2022年了,pointer-network现在看来的作用是什么?
2021-11-26
总被主管说文档写的不好怎么办?
2021-11-18
NER任务只有一个类的情况下,BME或者Yes-No的数据预处理方式对结果有影响吗?
2021-11-08
学好数学对于编程的真实增益的性价比到底如何?
2021-11-03
学好数学对于编程的真实增益到底是多少?
2021-11-03
如果说每一个数学公式都在描述一件事情,那么数学公式的推导,是在做什么?
2021-10-26
每个物理公式是否都是在【描述】一个事情?
2021-10-12
求通俗讲讲数学或理论物理进行研究的细节,复杂公式是不是也都是由基础公式而来?
2021-09-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人