Code Monkey home page Code Monkey logo

interview's Introduction

面试常见基础编程题

1.排序:Sort.java

原数组:				4 46 26 31 85 11 25 43 3 82 97 6 67 85 49 74 31 37 9 89
1、冒泡排序:			3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
2、选择排序:			3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
3.1、插入排序:			3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
3.2、插入排序(链表):	3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97 
4、希尔排序:			3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
5.1、归并排序(递归):	3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
5.2、归并排序(非递归):	3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
5.3、归并排序(链表):	3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97 
6、快速排序:			3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
7、堆排序:				3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97
8、计数排序:			3 4 6 9 11 25 26 31 31 37 43 46 49 67 74 82 85 85 89 97

2.二叉树:Btree

1.创建二叉树:ABD*G**E**CF***
2.先序遍历:ABDGECF
3.中序遍历:DGBEAFC
4.后序遍历:GDEBFCA
5.先序遍历(非递归):ABDGECF
6.中序遍历(非递归):DGBEAFC
7.后序遍历(非递归):GDEBFCA
8.广度优先遍历:ABCDEFG
9.求二叉树的最大高度:4
10.求二叉树的最小高度:3
11.root2是root1的子树:true

3.双端队列(LinkedList)和优先级队列(PriorityQueue):MyList.java

队列操作:入队顺序
2 1 3 
LinkedList: 先进先出
2 1 3 
LinkedList: 后进先出
3 1 2 
PriorityQueue: 优先级出队(默认最小优先级高)
1 2 3 
PriorityQueue: 优先级出队(设置为最大优先级高)
3 2 1 

4.Map(HashMap, LinkedHashMap, TreeMap)对比:MyMap.java

Map操作:put的顺序
abc=D
1=A
2=B
3=C
HashMap: key无序
1=A
2=B
abc=D
3=C
LinkedHashMap: key有序(put的顺序)
abc=D
1=A
2=B
3=C
TreeMap: key有序(默认升序)
1=A
2=B
3=C
abc=D
TreeMap: key有序(设置为减序)
abc=D
3=C
2=B
1=A

interview's People

Contributors

zhouweixin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.