- 博客(14)
- 收藏
- 关注
原创 面向对象
面向对象方式:面向对象方式 面向对象方式使得程序员使得程序员不会受限于任何特定类型的问题。我们将问题空间中的元素及其在解空间中的表示称为“对象”。 这种思想的实质是:程序可以通过添加新类型的对象使自身适用于某个特定问题。 相比之前我们使用的语言,这是一种更灵活和更强有力的语言抽象。因此OOP允许根据问题来描述问题,而不是根据运行解决方案的计算机来描述问题。 ...
2019-01-31 18:04:46 85
原创 线性表之栈(数据结构day05)
栈什么是栈 栈,stack,是限定在表的一端进行插入和删除预算的线性表 通常,将删除与插入的一端称为栈顶,每次退栈(即删除一个元素)的必是最后一个进栈的元素,而第一个进栈的元素必然是最后一个退栈的。即在栈中,元素具有先进后出,后进先出的特点,故把栈也称为先进后出的线性表,LIFO表(Last in first out).栈的顺序存...
2019-01-26 19:58:31 152
转载 C语言链表各类操作详解
1.单链表的读取获取链表第i个数据的算法思路:声明一个指针p指向链表的第一个结点,初始化j从1开始;当j< i 时,遍历链表,让p的指针向后移动,不断指向下一结点,j累加1;若到链表末尾p为空,说明第i个元素不存在;否则查找成功,返回结点p的数据。/*初始条件:顺序线性表L已存在,1≤i≤ListLength(L)*//*操作结果: 用e返回L中第i个数据元素的值*/St...
2019-01-23 23:17:09 6748
原创 数据结构之线性表(数据结构day04)
线性表的定义和基本运算线性表的逻辑定义线性表,Linear_List是最简单和最常用的一种数据结构。线性表是由n个数据元素(结点)a1,a2,…,an组成的有限序列。类比数学中的数列概念。其中我们规定数组元素的个数n为该线性表的长度,size。当n为零时,称为空表。非空的线性表通常记为:(a1,a2,a3,…,an),其中ai(1<=i<=n)表示线性表的其中一个结点。...
2019-01-23 22:50:41 256
转载 理解有参构造器和无参构造器的作用
一、概念java中构造方法指的是:与类名相同,无返回类型的方法,参数可以为空,也可以带参数。比如一个 Dao 类,private Dao(){}这个就是无参数的构造方法。private Dao(String name){}这个就是带参数的构造方法。作用:用来初始化 java 类,提供类的初始化和实例化,以便调用。二、作用new一个对象的时候要用到构造函数,例如Hello hello...
2019-01-23 19:51:35 1328
原创 数据结构的认知(数据结构day03)
If you give someone a program,you will frustrate them for a day;if you teach them how to program,you will frustrate them for a lifetime数据结构数据结构是相互之间存在一种或多种特定关系的数据元素的集合。是一门研究非数值计算的程序设计问题中的操作对象,以及他们之间...
2019-01-23 17:30:02 261
原创 计算机体系的认知(数据结构day2)
什么是IT?作为今后的IT人员,对 IT 没有一个明确的认识,实属有点说不过去。所谓IT是指信息技术(Information Technology),也称为信息和通信技术(Information and Communications Technology,ICT),是主要用于管理和处理信息所采用的各种技术总称,主要是应用 计算器科学 和通信技术来设计,开发,安装和部署信息系统及应用软件。冯·诺...
2019-01-21 22:49:43 441
原创 斐波那契数列(数据结构day01)
斐波那契数列斐波那契数列,又称为黄金分割数列( 当n趋于无穷大时,前一项与后一项的比值越来越趋于黄金分割比0.618 ),因数学家列昂纳多·斐波那契(Leonardoda Fibonacci),以兔子繁殖为例引入,故又称为“兔子数列”,指的是这样一个数列:1,1,2,3,5,8,13,21,34… … 这个数列从第三项开始,每一项都等于前两项数列之和,即F(n)=F(n-1)+F(n-2)。斐...
2019-01-20 19:37:10 643
原创 leetcode解题之 27. Remove Element Java版
27. Remove ElementGiven an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modify...
2019-01-04 23:55:35 219
原创 leetcode解题之 26. Remove Duplicates from Sorted Array Java版
Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for anoth...
2019-01-04 23:37:13 226
原创 leetcode解题之 18. 4Sum Java版
4SumGiven an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum o...
2019-01-04 23:21:06 142
原创 leetcode解题之 16. 3Sum Closest Java版
16. 3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that ...
2019-01-03 19:35:53 212
原创 leetcode解题之 15. 3Sum Java版
3SumGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not c...
2019-01-02 22:18:26 91
原创 LeetCode 11 Container With Most Water(最大水容器)
标题SummaryWe have to maximize the Area that can be formed between the vertical lines using the shorter line as length and the distance between the lines as the width of the rectangle forming the area....
2019-01-01 20:45:49 114
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人