![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
文章平均质量分 64
ttgump
这个作者很懒,什么都没留下…
展开
-
扫雷的java程序
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class JMinesweeper extends JFrame { private int row = 10; private int column = 10; private int bombsNumbe原创 2012-04-17 14:13:23 · 454 阅读 · 0 评论 -
LeetCode: Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 这个题目直接用原创 2014-04-26 14:39:44 · 349 阅读 · 0 评论 -
LeetCode: Permutation Sequence
/* The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3): "123" "132" "2原创 2014-04-26 14:36:51 · 486 阅读 · 0 评论 -
LeetCode: Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321原创 2014-04-08 01:46:05 · 446 阅读 · 0 评论 -
LeetCode: Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2,原创 2014-04-08 01:40:47 · 448 阅读 · 0 评论 -
LeetCode: Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 使用ha'sh原创 2014-04-08 01:51:08 · 894 阅读 · 0 评论 -
LeetCode: Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from th原创 2014-04-08 01:43:40 · 473 阅读 · 0 评论 -
LeetCode: Remove Duplicates from Sorted List
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place wi原创 2014-04-05 14:35:14 · 300 阅读 · 0 评论 -
Leetcode: Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 此题用递归的方法,首先找到数组中的中值作为root,之后把中值左边的和右边的数组作为新数组分别做递归。 /** * Definition for binary tree * publi原创 2014-04-05 13:50:36 · 334 阅读 · 0 评论 -
一个五子棋的java程序
import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Gomoku extends JFrame { privatefinal int CHESSBOARD_SIZE = 15; privateJLabel jblWhite = new JLabel("Whit原创 2012-04-17 14:11:52 · 757 阅读 · 0 评论 -
LeetCode: Merge two sorted linked 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 14:42:28 · 455 阅读 · 0 评论 -
LeetCode: Linked_List_Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space?原创 2014-04-05 13:54:39 · 360 阅读 · 0 评论 -
贪吃蛇的java程序
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Snake extends JFrame { private SnakePanel snakePanel = new SnakePanel(); private static final long serialV原创 2012-04-17 14:16:00 · 419 阅读 · 0 评论 -
LeetCode: Linked List Cycle
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space?原创 2014-04-05 13:53:07 · 275 阅读 · 0 评论 -
Leetcode: Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Note: Recursive solutio原创 2014-04-05 13:48:17 · 343 阅读 · 0 评论 -
Leetcode: Binary_Tree_Postorder_Traversal
/* Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. Note: Recursive so原创 2014-04-05 13:42:19 · 382 阅读 · 0 评论 -
LeetCode: Add Two Numbers
/* You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a原创 2014-04-26 14:42:45 · 528 阅读 · 0 评论