![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
面试题
青眼酷白龙
这个作者很懒,什么都没留下…
展开
-
Windows API函数大全
Windows API函数大全,从事软件开发的朋友可以参考下1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnection 结束一个网络连接 WNetCancelConnection2 结束一个网络连接 WNetCloseEnum 结束一次枚举操作 WNetConnectionDialog 启动一原创 2021-01-26 12:41:06 · 212 阅读 · 0 评论 -
推箱子游戏 C语言
#pragma once#define A 2#define B 6#define C 5typedef struct{ int x, y;}Point;Point point[] = { {8,8},{9,9},{7,10},{8,6},{8,8},{11,13},{8,10},{7,10},{9,11},{8,7},{6,12},{7,8},{13,10},{7,8},{7,8},{9,10},{7,9},{9,10}, {8,10},{8,7},{8,11原创 2021-01-25 21:47:56 · 175 阅读 · 0 评论 -
黑白棋 C#版本
using System;using System.Drawing;using System.Threading;using System.Windows.Forms;namespace WindowsApplication1{ public partial class Form1 : Form { private int x1; //落子位置 private int y1; private int[,] Ma原创 2021-01-24 22:07:04 · 793 阅读 · 1 评论 -
连连看 C#版本
using System;using System.Collections;using System.Drawing;using System.Threading;using System.Windows.Forms;//ArrayList命名空间namespace 连连看{ public partial class Form1 : Form { private Bitmap Source; //所有动物图案的图片 private int W原创 2021-01-24 20:49:51 · 274 阅读 · 0 评论 -
贪吃蛇 C语言版本
#include<stdafx.h> //vc自带头文件#include<stdio.h> //标准输入输出函数库#include<time.h> //用于获得随机数#include<windows.h> //控制dos界面#include<stdlib.h> //即standard library标志库头文件,里面定义了一些宏和通用工具函数#include<conio.h> //接收键盘输入输出/原创 2021-01-24 10:41:10 · 135 阅读 · 0 评论 -
2048 C语言版本
#include <stdio.h> //标准输入输出函数库(printf、scanf)#include <conio.h> //为了读取方向键#include <windows.h>//控制dos界面(获取控制台上坐标位置、设置字体颜色)#include <math.h> //pow函数/*******函 数 声 明*******/void gotoxy(int x, int y); //获取屏幕光标位置int color(in原创 2021-01-24 10:02:30 · 489 阅读 · 2 评论 -
红黑树java api
package cn.it.algorithm.tree;public class RedBlackTree<Key extends Comparable<Key>, Value> { //根节点 private Node root; //记录树中元素的个数 private int N; //红色链接 private static final boolean RED = true; //黑色链接 private s.原创 2021-01-18 14:01:54 · 273 阅读 · 0 评论 -
希尔排序
//算法8.3 希尔排序#include <iostream>using namespace std;#define MAXSIZE 20 //顺序表的最大长度typedef struct{ int key; char *otherinfo;}ElemType;//顺序表的存储结构 typedef struct{ ElemType *r; //存储空间的基地址原创 2021-01-16 20:38:58 · 157 阅读 · 0 评论 -
折半插入排序
//算法8.2 折半插入排序#include <iostream>using namespace std;#define MAXSIZE 20 //顺序表的最大长度typedef struct{ int key; char *otherinfo;}ElemType;//顺序表的存储结构 typedef struct{ ElemType *r; //存储空间的基地原创 2021-01-16 20:26:02 · 243 阅读 · 0 评论 -
直接插入排序
//算法8.1 直接插入排序#include <iostream>using namespace std;#define MAXSIZE 20 //顺序表的最大长度typedef struct{ int key; char *otherinfo;}ElemType;//顺序表的存储结构 typedef struct{ ElemType *r; //存储空间原创 2021-01-16 20:15:16 · 324 阅读 · 0 评论 -
根据赫夫曼树求赫夫曼编码
//算法5.11 根据赫夫曼树求赫夫曼编码#include<iostream>using namespace std;typedef struct{ int weight; int parent,lchild,rchild;}HTNode,*HuffmanTree;typedef char **HuffmanCode;void Select(HuffmanTree HT,int len,int &s1,int &s2){ int i,min1=0x3f3f原创 2021-01-16 19:02:33 · 1033 阅读 · 2 评论 -
拓扑排序
//算法6.12 拓扑排序#include <iostream>using namespace std;#define MVNum 100 //最大顶点数#define OK 1 #define ERROR 0 typedef char VerTexType;//- - - - -图的邻接表存储表示- - - - - typedef struct ArcNode{ //边结点 int原创 2021-01-16 14:07:04 · 156 阅读 · 0 评论 -
关键路径算法
//算法6.13 关键路径算法#include <iostream>using namespace std;#define MVNum 100 //最大顶点数#define BDNum MVNum * (MVNum - 1) //最大边数#define OK 1 #define ERROR 0 typedef char VerTexType;//- - - - -图的邻接表存储表示- - - - - typedef st原创 2021-01-16 13:15:27 · 426 阅读 · 0 评论 -
迪杰斯特拉算法和弗洛伊德算法
//算法6.10 迪杰斯特拉算法#include <iostream>using namespace std;#define MaxInt 32767 //表示极大值,即∞#define MVNum 100 //最大顶点数typedef char VerTexType; //假设顶点的数据类型为字符型 typedef int ArcType;原创 2021-01-14 21:24:04 · 491 阅读 · 0 评论 -
最小生成树 普里姆算法 和 克鲁斯卡尔算法
//算法6.8 普里姆算法#include <iostream>using namespace std;typedef char VerTexType;typedef int ArcType;#define MVNum 100#define MaxInt 32767 //表示极大值,即∞//辅助数组的定义,用来记录从顶点集U到V-U的权值最小的边struct{ VerTexType adjvex; //最小边在U中的那个顶点原创 2021-01-13 22:53:25 · 616 阅读 · 0 评论 -
KMP算法
/***字符串匹配算法***/#include<cstring>#include<iostream>using namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status;#define MAXSTRLEN 255 //用户可在255以内定义最长串长typedef char SString[MAXSTRLEN+1]; //0号单元存放串的长度Statu.原创 2021-01-11 21:20:44 · 532 阅读 · 0 评论 -
N皇后问题(Java版)和C++版
package day012;import java.util.Scanner;public class NQuene { static final int M = 105; static int n; static int[] x = new int[M]; static int countn; public static void main(String[] args) { Scanner scanner = new Scanner(S原创 2021-01-10 21:20:05 · 112 阅读 · 1 评论 -
Java递归(回溯法)求全排列
package Test;import java.util.LinkedList;import java.util.List;public class Test11 { public static void main(String[] args) { System.out.println(permute(new int[]{1, 2, 3,4})); } static List<List<Integer>> res = new Li原创 2021-01-08 16:29:58 · 420 阅读 · 0 评论 -
Java代码求子集
import java.util.ArrayList;import java.util.Arrays;import java.util.List;public class Test9 { public static void main(String[] args) { List<Integer> nums = new ArrayList<>(); nums.add(1); nums.add(2); .原创 2021-01-08 16:11:28 · 289 阅读 · 0 评论 -
二分查找算法java版实现(递归实现与非递归实现)
package Test;public class Test8 { /** * 二分查找 */ public static final void testTwoPointSearch() { int[] source = new int[] { 1,13,21,35,39,51,62,78,99 }; System.out.println(twoPointSearch(source, 22)); System.o原创 2021-01-08 14:24:10 · 196 阅读 · 0 评论 -
二叉堆的设计javaAPI
//二叉堆public class MaxPQ <Key extends Comparable<Key>> { // 存储元素的数组 private Key[] pq; // 当前 Priority Queue 中的元素个数 private int N = 0; public MaxPQ(int cap) { // 索引 0 不用,所以多分配一个空间 pq = (Key[]) new Comp原创 2021-01-08 11:08:32 · 104 阅读 · 0 评论 -
去重
package Test;public class Test2 { public static void main(String[] args) { int[] ints = {0, 0, 1, 1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 8}; int i = removeDuplicates(ints); for (int j = 0; j < i; j++) { System.out.printl原创 2021-01-07 22:54:13 · 79 阅读 · 1 评论 -
unordered_map
#include <iostream> #include <unordered_map> #include <map>#include <string> using namespace std; int main() { //注意:C++11才开始支持括号初始化 unordered_map<int, string> myMap={{ 5, "张大" },{ 6, "李五" }};//使用{}赋值 myMa原创 2021-01-07 22:51:48 · 89 阅读 · 0 评论 -
合法括号判定
import java.util.Stack;public class Test04 { public static void main(String[] args) { System.out.println(isValid("{[{[]}]}")); System.out.println(isValid("{[{[]}]")); } static Boolean isValid(String str) { Stack<Ch原创 2021-01-07 22:49:28 · 298 阅读 · 0 评论 -
最小覆盖字串和字母异位词和无重复字符的最长字串
#include <iostream>#include <string>#include <unordered_map>#include <vector>using namespace std;string minWindow(string s, string t);vector<int> findAnagrams(string s, string t);void ShowVec(const vector<int>原创 2021-01-07 22:46:16 · 77 阅读 · 0 评论 -
0-1背包问题和完全背包问题
package day009;public class KnapBag { public static void main(String[] args) { change(5,new int[]{1,2,5}); } static int change(int amount, int[] coins) { int n = coins.length; int[][] dp = new int[n + 1][amount + 1];.原创 2021-01-04 22:06:42 · 128 阅读 · 0 评论 -
数组遍历问题 斜角打印数组
原创 2021-01-01 12:46:29 · 291 阅读 · 0 评论 -
动态规划之最大子数组问题
原创 2021-01-01 10:03:14 · 218 阅读 · 0 评论 -
在一起盗窃案中,法官对涉及到的四名犯罪嫌疑人A,B,C,D进行了审问.
在一起盗窃案中,法官对涉及到的四名犯罪嫌疑人A,B,C,D进行了审问.A说:“罪犯在B,C,D三人之中.”B说:“是C偷的.”C说:“在A,D中间有一人是罪犯.”D说:“B说的是事实.”经查证,四人中有两人说了假话,两人说了真话。你能找出真正的罪犯吗?...原创 2020-12-26 14:04:16 · 3985 阅读 · 2 评论 -
0814 大数据面试题总结 --part1
原创 2020-08-14 16:06:33 · 122 阅读 · 0 评论 -
蒙特卡罗算法
蒙特卡罗算法求圆周率import java.util.Scanner;public class MonteCarlo { // 蒙特卡罗算法 static double MontePI(int n) { double x, y; int sum = 0;//记录落在阴影部分的点的个数 for (int i = 0; i < n; i++) { // 产生0~1之间的一个随机数 x = Math.random();原创 2020-07-29 00:19:38 · 142 阅读 · 0 评论 -
java中的零拷贝原理图
原创 2020-07-23 21:29:16 · 132 阅读 · 0 评论 -
Java面试的真题6月25日
1 面向对象和面向过程的区别面向过程优点:性能比面向对象高,因为类调用时需要实例化,开销比较大,比较消耗资源;比如单片机、嵌入式开发、Linux/Unix等一般采用面向过程开发,性能是最重要的因素缺点:没有面向对象易维护、易复用、易扩展面向对象优点:易维护、易复用、易扩展,由于面向对象有封装、继承、多态性的特性,可以设计出低耦合的系统,使系统更加灵活、更加易于维护。缺点:性能比面向过程低。2 java的四个基本特性抽象就是把现实生活中的某一类东西提取出来,用程序原创 2020-06-25 11:17:29 · 177 阅读 · 0 评论 -
java类实例化顺序+经典的面试题
java类实例化顺序+经典的面试题1 类初始化阶段类初始化阶段底层有<cinit>方法完成,<cinit>方法是有静态变量赋值语句和静态代码块的结合而形成的。静态变量赋值语句和静态代码块的执行顺序有其本身编码顺序决定,自上往下执行。如果父类存在静态资源的初始化,那么父类会优先与子类完成执行<cinit>方法。因为子类是依赖父类而存在的。一个类中如果没...原创 2020-04-28 13:23:26 · 454 阅读 · 0 评论