wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ String, LinkedList

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

jika dua string identik maka fungsi strcmp() mengembalikan nilai?

a)

0

b)

true

c)

1

d)

null

2.

apa keluaran dari program berikut ?

#include <stdio.h>

#include<string .h>

void main()

{

char str1[20]="Hello",str2="world";

strcat(str1,str2);

puts(str1);

return 0;

}

a)

Hello

b)

Helloworld

c)

world

d)

false

3.

Keuntungan apa yang dimiliki linked list dibandingkan array?

a)

Ukuran list tidak perlu disebutkan di awal program

b)

Linked list tidak memiliki batas ukuran

c)

Anda dapat menambahkan atau menghapus elemen dari tengah list.

d)

semua benar

4.

Node dalam linked list berisi dua hal

a)

Direction and a pointer

b)

A Pointer and a reference

c)

Data and a pointer

d)

A pointer and a node

5.

Apa yang akan dicetak ketika Head->next->data dieksekusi seperti pada gambar di atas?

a)

83

b)

27

c)

9

d)

error

6.

Node terakhir dari linked list tunggal berisi________

a)

INFO

b)

NEXT

c)

NULL

d)

0

7.

Linked list umumnya dianggap sebagai contoh _________ jenis alokasi memori.

a)

static

b)

dynamic

c)

runtime

d)

main

8.

gambar ini merepresentasikan operasi pada linked list?

a)

node penghapusan di depan

b)

hapus node di tengah

c)

hapus node di akhir

9.

Apa operasi dari pernyataan di bawah ini?

a)

Insert a new node to the front of a linked list

b)

Create a new node for a linked list

c)

Insert a new node to the end of the linked list

d)

Calculate the size of a linked list

10.

str1="6/4";

printf("str1");

a)

6/4

b)

None

c)

str1