Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- List



  3 ways to remove duplicates in List

Frequently, we may have an ArrayList which stores many values, and we need to process the ArrayList and get what are the distinct values in the list, or we may want to count occurrence of each value in the ArrayList. We can remove the duplicates in a few ways. Here we propose 3 methods :     public static void main(String[] args){        //SuperClass sub=new SubClass();                String[...

   Java,List,Duplicate,Clear     2012-09-03 09:44:32

  Algorithm : Reverse singly linked list

Questions about singly linked list are the lovers of interviewers during interviews given the characteristic that singly linked list is one-directional list and it's difficult to get the previous node of one node without some buffering tricks.  In this post, we will demonstrate one of the most frequently asked question about singly linked list -- Reversing the singly list. Given the first node of a singly linked list, reverse the singly linked list. For example : A->B->C->D After ...

   ALGORITHM,INTERVIEW,C     2015-10-31 11:38:35

  Algorithm : Delete middle node from singly linked list

Questions about singly linked list are frequently asked during technical interviews. Today we will share with you one algorithm question about singly linked list. Here is the problem description. Assuming the only information you are giving is there is a pointer to a middle node of a singly linked list, no other information about the linked list is given. Please delete this node and don't affect the structure of the linked list. Initially you may think this question is easy if you know the hea...

   ALGORITHM,C,LINKED LIST     2015-10-30 05:21:25

  Java SynchronizedList and Iterator

While reading some material about concurrency, I come up with some writing about using SynchronizedList wrap about normal List to enable synchronization.   But one interesting thing is http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedList%28java.util.List%29   It says     It is imperative that the user manually synchronize on the returned list when iterating over it:     1   List list = Collections.synchronizedList(new A...

       2015-12-03 03:04:08

  What are your list of must know programming proverbs?

It is in fact a good list of proverbs and here are some of the frequently seen programming proverbs. Keep It Simple Stupid Don’t Repeat Yourself A clever person solves a problem. A wise person avoids it – Einstein Silence is construed as approval  ( Picked from Kevin blog ) There is no smoke without fire Think first, Program later Never assume the computer assumes anything Don't trust anything from the user input Do you have any favorite of the programming proverbs? ...

   PROGRAMMING,TIPS     2011-07-01 07:00:56

  Permutation implementation in Java

Permutation is a very basic and important mathematic concept we learned in school. It has very practical applications in real world. For example, in football. In simple, permutation describes all possible ways of doing something. For example, there are six permutations of the set {1,2,3}, namely: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1). In general, for n items, there are n! number of permutations to arrange these items. How can we implement this algorithm in programming programm...

   Permutation,Implementation,Java,Sample     2015-03-26 02:18:14

  A Python assignment trap

Python has no assignment, it only has reference. Assume, we have following code snippet: >>> values = [0, 1, 2] >>> values[1] = values >>> values [0, [...], 2] Why the result is not [0, [0, 1, 2], 2], instead it goes into an infinite loop? To understand this, we need to understand some basics about Python. Python has no variables, it only has labels. When we run: values = [0, 1, 2] Python will first create a list object [0,1,2], then it labels it as values. If we later...

   Python,Assignment,Trap,Shallow copy     2013-07-19 22:08:36

  What's on your Learning List?

How do you track and decide what topics you want to spend time learning? For a while, I didn’t have a real good solution. Something would trigger me to remember “Oh yeah! I really wanted to learn more about that”. I would spend the evening doing busy learning - it seemed like I was learning but I really wasn’t. Instead of trying to do Deliberate Practice, I’d fool myself into thinking I was investing my time wisely by reading blog posts and examples but no...

   Learning list,Conscious,Study,Programming     2011-12-05 12:44:39

  Google Drive will support offline editing soon

Normal 0 7.8 pt 0 2 false false false EN-US ZH-CN X-NONE    Google Drive,Offline editing,Cloud computing     2012-06-04 06:42:47

  Top 10 essential Java classes

When we write Java programs, we will frequently use some classes such as java.lang.String. There are some essential Java classes which we may use frequently, there is no strict rules for the selection of essential Java classes, in fact there are no rules followed. It depends on what projects you are doing or what you have done,, so every one may have his own choices about the top essential Java classes in his mind. Here we list the top 10 essential Java classes you may agree with.1. java.lang.St...

   Java,class,essential class,top 10     2012-06-04 09:44:19