先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024b (备注Java)
正文
- will set h->iskey. */
raxSetData(h,data);
rax->numele++;
return 1; /* Element inserted. */
}
/* If the node we stopped at is a compressed node, we need to
-
split it before to continue.
-
Splitting a compressed node have a few possible cases.
-
Imagine that the node ‘h’ we are currently at is a compressed
-
node contaning the string “ANNIBALE” (it means that it represents
-
nodes A -> N -> N -> I -> B -> A -> L -> E with the only child
-
pointer of this node pointing at the ‘E’ node, because remember that
-
we have characters at the edges of the graph, not inside the nodes
-
themselves.
-
In order to show a real case imagine our node to also point to
-
another compressed node, that finally points at the node without
-
children, representing ‘O’:
-
"ANNIBALE" -> "SCO" -> []
-
When inserting we may face the following cases. Note that all the cases
-
require the insertion of a non compressed node with exactly two
-
children, except for the last case which just requires splitting a
-
compressed node.
-
- Inserting “ANNIENTARE”
-
|B| -> "ALE" -> "SCO" -> []
-
"ANNI" -> |-|
-
|E| -> (... continue algo ...) "NTARE" -> []
-
- Inserting “ANNIBALI”
-
|E| -> "SCO" -> []
-
"ANNIBAL" -> |-|
-
|I| -> (... continue algo ...) []
-
- Inserting “AGO” (Like case 1, but set iscompr = 0 into original node)
-
|N| -> "NIBALE" -> "SCO" -> []
-
|A| -> |-|
-
|G| -> (... continue algo ...) |O| -> []
-
- Inserting “CIAO”
-
|A| -> "NNIBALE" -> "SCO" -> []
-
|-|
-
|C| -> (... continue algo ...) "IAO" -> []
-
- Inserting “ANNI”
-
"ANNI" -> "BALE" -> "SCO" -> []
-
The final algorithm for insertion covering all the above cases is as
-
follows.
-
============================= ALGO 1 =============================
-
For the above cases 1 to 4, that is, all cases where we stopped in
-
the middle of a compressed node for a character mismatch, do:
-
Let $SPLITPOS be the zero-based index at which, in the
-
compressed node array of characters, we found the mismatching
-
character. For example if the node contains “ANNIBALE” and we add
-
“ANNIENTARE” the $SPLITPOS is 4, that is, the index at which the
-
mismatching character is found.
-
- Save the current compressed node $NEXT pointer (the pointer to the
-
child element, that is always present in compressed nodes).
-
- Create “split node” having as child the non common letter
-
at the compressed node. The other non common letter (at the key)
-
will be added later as we continue the normal insertion algorithm
-
at step “6”.
-
3a. IF $SPLITPOS == 0:
-
Replace the old node with the split node, by copying the auxiliary
-
data if any. Fix parent's reference. Free old node eventually
-
(we still need its data for the next steps of the algorithm).
-
3b. IF $SPLITPOS != 0:
-
Trim the compressed node (reallocating it as well) in order to
-
contain $splitpos characters. Change chilid pointer in order to link
-
to the split node. If new compressed node len is just 1, set
-
iscompr to 0 (layout is the same). Fix parent's reference.
-
4a. IF the postfix len (the length of the remaining string of the
-
original compressed node after the split character) is non zero,
-
create a "postfix node". If the postfix node has just one character
-
set iscompr to 0, otherwise iscompr to 1. Set the postfix node
-
child pointer to $NEXT.
-
4b. IF the postfix len is zero, just use $NEXT as