wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

רשימות מקושרות

Total questions: 13

Worksheet time: 11mins

Name
Class
Date
1.

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 מהו מבנה הרשימה שמתחילה ב ־


a)

3 → 2 → 1

b)

3 → 2

c)

3 → 1

d)

3

2.

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()


a)

5

b)

7

c)

9

d)

null

3.

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 מה יהיו הערכים ברשימה שמתחילה ב ־


a)

12 → 8 → 4

b)

12 → 8 → 100

c)

12 → 100 → 4

d)

 12 → 8

4.

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 מהו המבנה שמתחיל ב ־


a)

4 → 3 → 2 → 1

b)

4 → 3 → 1

c)

4 → 3 → 2

d)

 4 → 3 → 1 → 2 → 1 → ...

5.

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()?


a)

true

b)

false

c)

null

d)

run-time error

6.

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 מהו המבנה שמתחיל ב ־


a)

30 → 20 → 10

b)

30 → 20 → 20 → … (לולאה)

c)

30 → 20

d)

30 → 10

7.

מה יוחזר ?

a)

1

b)

2

c)

3

d)

3

8.

איך תיראה הרשימה לאחר הקריאה לפעולה ?

a)

1→2→4→5→6→7

b)

1→2→3→5→6→7

c)

1→2→4→5→7

d)

1→2→4→6→7

9.

איך תיראה הרשימה ?

a)

1→3→2→4→5→6

b)

2→1→4→3→6→5

c)

2→1→3→4→6→5

d)

 2→1→4→3→5→6

10.

איך תיראה הרשימה ?

a)

5

b)

 -1→3→5

c)

3→-4→5

d)

3→5

11.

מה הערך המוחזר ?

(a)  

12.

מה השרשרת שנוצרה ?

a)

first: #→#→#→#→#→null

b)

first: #####→####→###→##→#→null

c)

first: #→##→###→####→#####→null

d)


first: →null

13.

מה הערך שיוחזר לאחר זימון הפעולה

secret עבור שרשרת החוליות הבאה?

be→ the→ change→you→ want→to→see→in→the→world

a)

be

b)

world

c)

the

d)

change