- 博客(20)
- 收藏
- 关注
转载 链表逆序、判断是否有环、求环的起点;两个链表是否相交、交点
链表是常用的数据结构。typedef struct Node{ ElemType data; Node* link;}Node, *List;常规链表操作,诸如遍历,插入,删除等就不再给出代码。需要注意的是,对链表的合法性进行检验;删除时,勿忘记释放其结点所占用的空间。 1、链表逆序: 链表逆序需要维护三个指针
2014-05-13 09:43:39
852
转载 Java与C++的区别
JAVA和C++都是面向对象语言。也就是说,它们都能够实现面向对象思想(封装,继乘,多态)。而由于c++为了照顾大量的C语言使用者,从而兼容了C,使得自身仅仅成为了带类的C语言,多多少少影响了其面向对象的彻底性!JAVA则是完全的面向对象语言,它句法更清晰,规模更小,更易学。它是在对多种程序设计语言进行了深入细致研究的基础上,摒弃了其他语言的不足之处,从根本上解决了c++的固有缺陷。一、Jav
2014-04-29 10:19:09
1211
原创 [LeetCode]Reverse Words in a String-反转单词
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Clarification:What constitutes a word?A sequence of non-sp
2014-04-16 15:51:09
674
原创 [LeetCode]Merge Two Sorted Lists-合并两个有序链表
题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
2014-04-05 16:24:34
722
原创 [LeetCode]Unique Binary Search Trees
题目:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2
2014-04-02 22:41:23
558
原创 [LeetCode]Same Tree
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.代码:
2014-04-02 21:40:02
676
原创 [LeetCode]Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.思路:树的递归遍历演化,从最简单的深度为1的树想,一个节点
2014-04-02 21:16:23
534
原创 [LeetCode]Single Number
Single NumberGiven an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it
2014-04-01 15:09:03
427
转载 研发/测试类笔试题总结(一)
1. 阿里巴巴启用了新的办公大厦,这里的一切都充满了现代感;工程师们打算在娱乐区用大小相等的圆形材料分割出一些空间,使用A,B,C三个圆形材料,最多可以将空间分为八个区域(包括圆形以外的区域),如果给你五个圆形材料,你最多可以帮助工程师们分出多少个空间? ( B ) A:20 B:22 C:26 D:32 这类问题一般都有固定的公式,告诉大家一个技巧:
2014-03-29 15:16:16
867
转载 研发/测试类笔试题总结(二)——测试
软件测试笔试题和面试题集汇适合刚毕业找工作应届毕业生 主要汇集一些常见的类型题型,权当抛砖引玉了。 (1) 软件测试基础题(这是考试软件测试概念,看基本功是否扎实) 1、 什么是软件测试(这个基本是都会问到,答不出来的先自己面壁) 指在目标计算机上利用输入数据,也称之为测试数据(test data)来实际运行该程序,把程序的实际行为与所期望的行为进行比较。如果两种行为不同,就可
2014-03-29 15:14:17
1363
原创 [LeetCode]Valid Number
Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement to be ambiguo
2014-03-29 14:23:56
812
转载 本体概述
(1)本体的具体清晰的解释 目前公认的是 1998/Studer :共享概念模型的明确的形式化规范说明 包括四个主要方面: 1. 概念化(conceptualization):客观世界的现象的抽象模型; 2. 明确(explicit):概念及它们之间联系都被精确定义; 3. 形式化(formal):精确的数学描述; 4. 共享(share):本体中反
2014-03-24 11:24:35
1510
原创 hadoop入门——wordcount
源码根据网上的实例,自己稍作修改,把文件读入输出地址,写在系统文件中,通过读文件控制。确认没错后,打成jar包运行:启动WinSCP,连上集群。把jar包放在自己的文件夹内,如 /home/tseg/zq。创建文件 /user/zq/text.txt,里面写明输入输出地址,如/user/zq/t.txt;/user/zq/out。 然后根据输入地址(/user/zq
2014-03-19 15:51:00
951
原创 在Mysql中导入.sql文件
首先进入控制台,创建一个数据库 db1,选择该数据库,用source命令导入即可create database db1;use db1;source e:/data/db.sql;
2013-07-25 15:26:25
537
原创 将数据库中内容展示在前台页面上
前面说过怎么遍历任意结构的table,那么后台读取以后怎么展示在前台呢?之前的想法是,在servlet中输出xml文件,然后在js中处理后输出。后来觉得麻烦,直接在servlet中输出html格式的文本,这样直接就在前台展示了。这样做其实不太好,不过方便。html:JS:function view() { var table=document.impor
2013-06-21 18:10:52
5757
原创 遍历数据表
知道table结构的情况下:Class.forName("com.mysql.jdbc.Driver").newInstance();Connection conn = (Connection) DriverManager.getConnection(connstr);String Sql = "select * from table" ;Statement st = conn.crea
2013-06-20 18:28:00
695
转载 SQL基础
SQL 基础一、SQL简介 现在SQL是基于SQL-86标准逐步修改出来的二、MySQL使用入门1、SQL分类 SQL语句主要分为3类:(1) DDL:数据定义语句,用于定义数据库对象,例如:create、drop、alter(2) DML:数据操纵语句,用于添加、删除、更新和查询数据库记录
2013-06-20 11:00:46
479
原创 一些小问题,URL等
1、URL地址问题弱爆了,弄了一天url还是写不对。../ 表示上级目录./ 表示本目录如果web.xml的servlet配置为: My_DBConn servlet.My_DBConn My_DBConn /servlet/My_DBConn 这时候,在js里的url可以写成“servlet/My_DBConn”
2013-06-20 10:40:22
498
原创 AJAX相关
1、AJAX基本框架xmlHttp.open("GET", url, true);xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { //具体操作 }}xmlHttp.send();var xmlHttp 实例化的方法
2013-06-20 10:28:01
747
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人