reviewed the classmates blog and code
This week's study of the knot
20172325
The contents of chapters 11th and 12th are studied together.
Other这两章是在老师讲了之后我才去看的。基本是看得懂的。但是老师说对于IO异常这个方面,更需要了解的是如何利用流进行读写文件等。这个方面我觉得我还不是很会,所以之后还会继续学习这个。而十二章,我觉得对于我来说,重点就是要了解它每一步的操作,因为我觉得书中的递归的代码写的十分的缜密,这个方面我也不擅长,就在编写后面的题时就可能想少东西,导致结果有问题。还需要学习。Learning progress Bar
lines of code (new/cumulative)
Blog Volume (Add/accumulate)
Learn
algorithm, O (n) - Public intLength () { to inti = 0; + for(Node This. Head.next; P! = This. Head; p =p.next) -i++; the returni; * } $ Panax Notoginseng //returns the element I (≥0) and returns NULL,O (n) if i - PublicT Get (inti) { the if(I >= 0) { +Node This. Head.next; A for(intj = 0; P! = This. Head J ) thep =P.next; + if(P! = This. Head) - returnP.data;//p points to the first node $ } $
Java Data Structure-linked list (1): Single-Chain tables and related common operations
Package LinkList; public class Node
{Public T data; // data domain public Node next; // Node domain // default constructor public Node () {}// constructor with parameters, public Node
of the second order is: 305 421 124 430 532 35 240And then sort the numbers on the hundreds:The result of the third Order is: 35 124 240 305 421 430 532Finally, our results are: 35 124 240 305 421 430 532At this point, the sorting of the arrays has been completedAttached Source: Public classRadixsort {@Test Public voidFun () {int[] n = {421, 240, 35, 532, 305, 430, 124}; Radixsort (n); for(inti:n) {System.out.print (i+ " "); } } //implement Cardinal sort lsd-from lowest bit start
, "E")};int[][] bestvalues = new int[pg.length+1][packagewheight+1];for (int i=0;iinterested students can go to my github to clone this project: Https://github.com/jimenbian/DynamicProgramereference: "1" http://blog.csdn.net/mu399/article/details/7722810"2" http://www.cnblogs.com/SDJL/archive/2008/08/22/1274312.html "3" http://blog.163.com/guixl_001/blog/static/41764104200863015855721//********************************* This article from the blog "Bo Li Garvin"* Reprint Please indicate the
Import Java.lang.reflect.Array;/*The specific principle in the C + + version has been said very clearly, here no longer repeat,Just a point: Java generics have a boundary effect, and once the departure scope is immediately replaced with the object type, reflection is required in the new generic array.*/Interface basestackBoolean push (T x);Boolean pop ();void Clear ();Ttop ();}public class JbstackT[] Mstack;int mmaxsize,mindex;static public void Main
str) {super . Append (str); return this ; }}2. What is StringBuffer?StringBuffer is a thread-safe variable String classJava.lang.StringBuffer inherits from Abstractstringbuilder (which is inherited from the class as well as StringBuilder, and some methods are implemented in that class), overriding most of its methods, without changing the logic to just change it to synchronized thread synchronization.Part StringBuffer Source: Public Final class stringbuffer extends abstractstringbuil
Java Data Structure series-tree (5): recursive and non-recursive implementations of post-sequential traversal of Binary Trees
Package tree. binarytree; import java. util. stack; /*** recursive and non-Recursive Implementation of Binary Tree post-sequential traversal ** @ author wl **/public class BitreePostOrder {// Re
24
12
3
24
12
3
45
24
12
3
20
45
24
12
3
20
15
25
45
24
12
3
20
15
25
32
45
For the first time, take the first number 32,From right to left, until you find a number smaller than 32, take the
need to add another condition, that is, if the pointer is empty, then the problem is solved.By the way, paste the code for the improved ToString method:@Overridepublic String toString() { return "[" + this.NodesToString(this) + "]";}/** * @param foLinkedList * @TODO 设置单链表的长度 * @return 单链表的节点字符串序列 */private String NodesToString(FOLinkedList3. Two pointer traversal to determine if the steps are equalIdeas:?? Set two working hands P, Q,p always go forward, but Q every time to start from the be
Topofstack minus 1.These operations are performed not only with constants, but also in very fast constant time. On some machines, the push and pop of integers can be written as a machine instruction if they operate on registers with Self-increment and self-reducing addressing Functions. Modern computers use stack operations as part of the instruction system, so the stack is probably the most important data struct
JAVA concurrency Data structure comparison implementationFor List,Set, andMap Concurrent applications, we can use the collections The following method converts a non-thread-safe List,set, andMap to Thread-safe. But efficiency is not the best,the JDK provides a dedicated thread-safe List and Set implementation class, We'll discuss their implementation later. Firs
:"+ Arrays.equals (A, b));//trueSystem. out. println ("5 position in a:"+ Arrays.binarysearch (A,5));//2 int[] C = arrays.copyof (A,6); System. out. println ("A and C are equal:"+ Arrays.equals (A, c));//falseSystem. out. println ("element of C:"+ arrays.tostring (c));//3,4,5,6,0,0Arrays.fill (c,2,4,1);//assigns the 3rd to 5th Element (not included) in C to a value of 1System. out. println ("element of C:"+ arrays.tostring (c));//3,4,1,1,0,0Arrays.sort (c); System. out. println ("element
Data Structure-queue implementation (JAVA)
For StackElement, see stack implementation.
Package com. lip. datastruture. stack; public class Queue
{Private StackElement
Obj; // private int size for saving data; // number of elements public Queue () {this. size = 0;} // public boolean enQueue (T
The so-called Huffman tree is required minimum weighted path length, what does this mean? In short, the path length (height-1) of all nodes is multiplied by the weight of the node, and the sum of these results is guaranteed to be minimal.The most common application of Huffman tree is solving coding problems. In general, we use ASCII is a fixed-length encoding, for those commonly used characters, the use of a long length is a little wasted space.The following is an example to build a Huffman codi
Like stacks, queue queues are also tables. However, when the queue is used, the insertion is made at one end and deleted at the other end.The basic operation of the queue is Enqueue (queued) and dequeue (out), and the team is inserting an element at the end of the rear (the table), and the exit is the element that is deleted at the head of the team front (the beginning of the table).As with stacks, any table implementation is possible for the queue, and for each operation, the list implementatio
When it comes to linear structures, we can be divided into three categories according to the way they are implemented:1) linear table of sequential structure2) linear table of chain structure3) Stack and queue linear table1. Linear table of sequential structure The so-called sequential storage, refers to the two elements in the physical storage address and the logical storage address is consistent, logically adjacent to the two elements, they are stor
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.