One of the interview summaries: Java handles linked list questions during the interview and java handles them

Source: Internet
Author: User

One of the interview summaries: Java handles linked list questions during the interview and java handles them
The linked list is often used in interviews. This article has referenced some other articles and added my own summary. Basically, every algorithm has been tested and optimized.
Algorithm Daquan (1) there are some linked list questions in a single-chain table, which will be sorted in the future.

* REFS:

* Http://blog.csdn.net/fightforyourdream/article/details/16353519

* Http://blog.csdn.net/luckyxiaoqiang/article/details/7393134 easily deal with linked list questions in the interview

* Http://www.cnblogs.com/jax/archive/2009/12/11/1621504.html algorithm Daquan (1) single-chain table



A question about JAVA linked list

Hello, I have modified it for you. You have added a comment on the modification. If you have any questions, please ask me:
Public class BaiduTest05 {
Public static void main (String [] args ){
Createline stu = new createline (10 );
Stu. Print (12 );
}
}

Class child {

Int num;
Child next = null;

Public child (int num ){
This. num = num;
}
}

Class createline {

Int len;
Child head = null;
Child p1 = null;

/**
**************************************** ************
* Create constructor and create a circular linked list
*
**************************************** ************
*/
Public createline (int len ){
This. len = len;
For (int I = 1; I <= this. len; I ++ ){
If (I = 1 ){
Child p2 = new child (I );
Head = p2;
P1 = p2;
} Else {
Child p2 = new child (I );
P1.next = p2;
P1 = p2;
}
}
P1.next = head; // put this sentence outside the for loop.
// P1 = head; // question point --> no use of this sentence
}

/**
***************************
* Print the linked list
*******************************
*/
Public void Print (int len) {// you can see that you are a circular Linked List by adding parameters here. Otherwise, how can you see the length of the printed linked list?
Child p2 = p1 = head;
For (int I = 1; I <= len; I ++ ){
System. out. println (p2.num );
P2 = p1.next;
P1 = p2;
}
P1 = this. head;
}
}... Remaining full text>

What are the frequently asked questions during the J2EE (JAVA) programmer interview? Who has summarized it? If a copy is sent to me,

Advantages and disadvantages of the three frameworks;
Advantages and disadvantages of MVC pattern;
JDBC compilation;
Object method;
Differences between a set and an array;
Differences between abstract classes and interfaces;
Interface and its method;
Thread synchronization problems;
Modify the class and attributes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.