私はVanderbilt UniversityのCS251を独自に学習しています。この作業は、文字配列のファサードラッパーを作成し、サイズを変更できるようにすることです。しかし、方法がありますprune()と私はそれが何をすべきか理解していません。あなたは、この方法が何を意味するかもしれないかについて、皆さんに何らかの光を当てることができますか私はその学校に行かないので、誰にも尋ねることはできません。ここJava:Javaのリンクリストのプルーンメソッド
、そのJavaコードのためのノードです。
private class Node {
/**
* Value stored in the Node.
*/
// TODO - you fill in here
/**
* Reference to the next node in the list.
*/
// TODO - you fill in here
/**
* Default constructor (no op).
*/
Node() {
}
/**
* Construct a Node from a @a prev Node.
*/
Node(Node prev) {
// TODO - you fill in here
}
/**
* Construct a Node from a @a value and a @a prev Node.
*/
Node(char value, Node prev) {
// TODO - you fill in here
}
/**
* Ensure all subsequent nodes are properly deallocated.
*/
void prune() {
// TODO - you fill in here
// Leaving the list fully linked could *potentially* cause
// a pathological performance issue for the garbage
// collector.
}
これは、リスト内の各ノードを、そのノードにリンクされているノードから単に「参照解除」していますか? –