Worksheetsרשימות מקושרות
Total questions: 13
Worksheet time: 11mins
Node<int> a = new Node<int>(1);
Node<int> b = new Node<int>(2, a);
Node<int> c = new Node<int>(3, b);
b.SetNext(null);
? c מהו מבנה הרשימה שמתחילה ב ־
3 → 2 → 1
3 → 2
3 → 1
3
Node<int> x = new Node<int>(7);
Node<int> y = new Node<int>(5, x);
Node<int> z = new Node<int>(1, x);
x.SetValue(9);
מה יהיה הערך של
y.GetNext().GetValue()
5
7
9
null
Node<int> n1 = new Node<int>(4);
Node<int> n2 = new Node<int>(8, n1);
Node<int> n3 = new Node<int>(12, n2);
n2.GetNext().SetValue(100);
n3 מה יהיו הערכים ברשימה שמתחילה ב ־
12 → 8 → 4
12 → 8 → 100
12 → 100 → 4
12 → 8
Node<int> a = new Node<int>(1);
Node<int> b = new Node<int>(2, a);
Node<int> c = new Node<int>(3, b);
Node<int> d = new Node<int>(4, c);
c.SetNext(a);
d מהו המבנה שמתחיל ב ־
4 → 3 → 2 → 1
4 → 3 → 1
4 → 3 → 2
4 → 3 → 1 → 2 → 1 → ...
Node<int> a = new Node<int>(5);
Node<int> b = new Node<int>(6, a);
Node<int> c = new Node<int>(7, b);
Node<int> d = new Node<int>(8, c);
c.SetNext(null);
מה יחזיר
d.GetNext().GetNext().HasNext()?
true
false
null
run-time error
Node<int> a = new Node<int>(10);
Node<int> b = new Node<int>(20, a);
Node<int> c = new Node<int>(30, b);
a.SetNext(b.GetNext());
c מהו המבנה שמתחיל ב ־
30 → 20 → 10
30 → 20 → 20 → … (לולאה)
30 → 20
30 → 10
מה יוחזר ?
1
2
3
3
איך תיראה הרשימה לאחר הקריאה לפעולה ?
1→2→4→5→6→7
1→2→3→5→6→7
1→2→4→5→7
1→2→4→6→7
איך תיראה הרשימה ?
1→3→2→4→5→6
2→1→4→3→6→5
2→1→3→4→6→5
2→1→4→3→5→6
איך תיראה הרשימה ?
5
-1→3→5
3→-4→5
3→5
מה הערך המוחזר ?
(a)
מה השרשרת שנוצרה ?
first: #→#→#→#→#→null
first: #####→####→###→##→#→null
first: #→##→###→####→#####→null
first: →null
מה הערך שיוחזר לאחר זימון הפעולה
secret עבור שרשרת החוליות הבאה?
be→ the→ change→you→ want→to→see→in→the→world
be
world
the
change
