上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页

2013年8月21日

malloc free vs new delete

摘要: String * ptr_str = static_cast(3*malloc(sizeof(String)));only Allocates the memory ;String * ptr_str2 = new String[3];calls the constructure of string class;delete[]ptr;if delete ptr only delte string[0] 阅读全文

posted @ 2013-08-21 02:29 brave_bo 阅读(110) 评论(0) 推荐(0)

2013年8月16日

未排序寻找连续 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... 阅读全文

posted @ 2013-08-16 07:05 brave_bo 阅读(256) 评论(0) 推荐(0)

leetcode -- find the lowest common ancestor

摘要: Given a binary tree, find the lowest common ancestor of two given nodes in the tree. _______3______ / \ ___5__ _... 阅读全文

posted @ 2013-08-16 05:09 brave_bo 阅读(266) 评论(0) 推荐(0)

实现一个 linkedlist

摘要: class Link { public int data1; public double data2; public Link nextLink; //Link constructor public Link(int d1, double d2) { data1 = d1; data2 = d2; } //Print Link data public void printLink() { System.out.print("{" + data1 + ", " + data2 + "} "); }}c... 阅读全文

posted @ 2013-08-16 04:32 brave_bo 阅读(183) 评论(0) 推荐(0)

OOP 的概念

摘要: This article provides a brief description about the various Object Oriented Programming concepts.Object Oriented ProgrammingIt is a type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data 阅读全文

posted @ 2013-08-16 03:53 brave_bo 阅读(286) 评论(0) 推荐(0)

java's static

摘要: staticvariables are shared by the entire class, not a specific instance (unlike normal member variables)staticmethods are also shared by the entire classstaticclasses are inner classes that aren’t tied to their enclosing classesstaticcan be used around a block of code in a class to specify code that 阅读全文

posted @ 2013-08-16 01:14 brave_bo 阅读(256) 评论(0) 推荐(0)

2013年8月15日

指针函数 函数指针

摘要: 函数指针是指向函数的指针,指针函数还是指一个函数的返回值是一个指针(1) float(**def)[10] def是什么?(2) double*(*gh)[10] gh是什么?(3) double(*f[10])() f是什么?(4) int*((*b)[10]) b是什么?(1) def是一个指针, 指向的对象也是一个指针, 指向的指针最终指向的是10个float构成的数组.(2) gh是指针, 指向的是10个元素构成的数组, 数组的元素是double*类型的指针.(3) f是10个元素构成的数组, 每个元素是指针, 指针指向的是函数, 函数类型为无参数且返回值为double. 下面要讲的窍 阅读全文

posted @ 2013-08-15 04:14 brave_bo 阅读(252) 评论(0) 推荐(0)

stack and heap

摘要: https://www.youtube.com/watch?v=_8-ht2AKyH4 阅读全文

posted @ 2013-08-15 02:58 brave_bo 阅读(126) 评论(0) 推荐(0)

polycom onsite

摘要: // Please do the following.// 1. void push(Object o);-- add element to the top// 2. Object pop(); -- remove element from the top// 3. boolean isEmpty(); -- true/false if stack is empty// Queue q;// void enqueue(Object o); -- add to the end of the queue// Object dequeue(); -- remove from the... 阅读全文

posted @ 2013-08-15 02:52 brave_bo 阅读(207) 评论(0) 推荐(0)

2013年8月14日

battleship

摘要: import java.util.ArrayList;import java.util.Scanner;public class game { private ArrayList ship = new ArrayList(); int numGuess = 0; public static void main(String[] args){ Game game = new Game(); game.setup(); } private void setup(){ ship.add(new S... 阅读全文

posted @ 2013-08-14 06:40 brave_bo 阅读(326) 评论(0) 推荐(0)

上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页

导航