1.
Yang termasuk struktur data sederhana yaitu
Correct Answer
A. Int, char, float, bool
Explanation
The given options include different data types and data structures. The data types int, char, float, and bool are simple data types that can store single values. They are considered simple because they do not have any internal structure. On the other hand, options like array, struct, tree, and linked list are data structures that can store multiple values or elements in a structured manner. Therefore, the correct answer includes the simple data types int, char, float, and bool.
2.
Type data dibawah ini, yang TIDAK termasuk dalam tipe data sederhana tunggal, adalah
Correct Answer
D. String
Explanation
The given answer "string" is correct because it is not a simple single data type. In programming, simple single data types refer to basic data types that can hold only one value at a time, such as integers (int), floating-point numbers (float), and characters (char). However, a string is a data type that can hold a sequence of characters or a text, making it different from the other options provided.
3.
==, <=, >=, !=, termasuk dalam operator
Correct Answer
B. Relasional
Explanation
The given operators "==, =, !=" are relational operators. Relational operators are used to compare two values and determine the relationship between them. These operators are commonly used in programming to compare numbers or strings and return a boolean value (true or false) based on the comparison result. Therefore, the correct answer is "relasional".
4.
Type data yang menghasilkan bentuk keluaran nilai True dan False (Benar dan Salah) , adalah
Correct Answer
C. Bool
Explanation
Boolean (bool) adalah tipe data yang menghasilkan bentuk keluaran nilai True dan False (Benar dan Salah). Tipe data ini digunakan untuk menyimpan nilai kebenaran atau hasil perbandingan dalam pemrograman.
5.
- void main()
- {
- .... x,y,z;
- clrscr();
- cout <<“\n input nilai X=“; cin >> x;
- cout <<“\n input nilai Y=“; cin >> y;
- z = x + y;
- cout <<“\n hasil penjumlahan =“ << z;
- getch();
- }
tipe data yang tepat untuk mengisi titik-titik pada baris 3 adalah
Correct Answer
A. Int
Explanation
The correct data type to fill in the blanks on line 3 is "int". This is because the variables x, y, and z are used to store integer values, as indicated by the arithmetic operation performed later in the code (x + y). Therefore, the appropriate data type to use for these variables is "int", which stands for integer.
6.
- main()
- {
- int r = 10,s;
- s = 10 + ++r;
- cout <<"r = "<< r << '\n';
- cout <<"s = "<< s << '\n';
- }
Hasil eksekusi dari program diatas adalah ….
Correct Answer
A. R = 11, s = 21
Explanation
The correct answer is "r = 11, s = 21" because the value of r is incremented before it is used in the expression s = 10 + ++r. The prefix increment operator (++r) increases the value of r by 1, so r becomes 11. Then, the expression s = 10 + 11 is evaluated, resulting in s being assigned the value of 21. Therefore, the output of the program will be "r = 11" and "s = 21".
7.
Yang bukan karakteristik array yaitu:
Correct Answer
B. Dinamis
Explanation
The correct answer is "dinamis". This is because arrays are not dynamic in nature. Once an array is created, its size cannot be changed. In contrast, dynamic data structures like linked lists allow for the addition or removal of elements at runtime. Arrays are also known for their random access property, which means that elements can be accessed directly using their index. Additionally, arrays are characterized by their homogeneity, meaning that all elements in an array must be of the same data type.
8.
Pada deklarasi: int A[5][4][2], jumlah elemen pada array tersebut sama dengan:
Correct Answer
B. 40
Explanation
The declaration int A[5][4][2] creates a three-dimensional array with dimensions of 5, 4, and 2. To find the total number of elements in the array, we multiply the dimensions together: 5 * 4 * 2 = 40. Therefore, the correct answer is 40.
9.
Setiap elemen dari sebuah Array haruslah mempunyai type data yang sama, termasuk dalam karakteristik array yaitu :
Correct Answer
C. Homogen
Explanation
The correct answer is "homogen" because one of the characteristics of an array is that each element must have the same data type. This means that all elements in the array should be of the same type, such as integers, strings, or booleans. This ensures that the array is consistent and can be easily accessed and manipulated.
10.
Array yang sering digunakan dalam menterjemahkan matriks pada pemrograman, adalah array berdimensi :
Correct Answer
B. 2
Explanation
Array yang sering digunakan dalam menterjemahkan matriks pada pemrograman adalah array berdimensi 2. Array berdimensi 2 digunakan untuk merepresentasikan matriks dengan baris dan kolom. Setiap elemen dalam array berdimensi 2 dapat diakses menggunakan indeks baris dan kolomnya.
11.
Contoh aplikasi array dimensi dua adalah
Correct Answer
C. Input nilai dan mata kuliah
Explanation
The correct answer is "input nilai dan mata kuliah". This is because inputting nilai (grades) and mata kuliah (subjects/courses) requires storing multiple values for each student or individual. Using a two-dimensional array allows for organizing and accessing this data efficiently, with one dimension representing the students and the other dimension representing the different subjects or courses.
12.
Diketahui float A[5] dan lokasi awal terletak di alamat 00F(H), maka lokasi A[3] adalah
Correct Answer
B. 017
Explanation
The given float array A[5] starts at address 00F(H). Each element in the array occupies a memory space of 4 bytes. Therefore, the address of A[3] can be calculated as follows: address of A[3] = address of A[0] + (size of each element * index of A[3]) = 00F(H) + (4 * 3) = 017.
13.
Tringular Array dapat merupakan Upper Tringular ataupun Lower Tringular. Upper tringular Array, yaitu:
Correct Answer
A. Seluruh elemen di bawah diagonal utama = 0
Explanation
The correct answer is that in an Upper Triangular Array, all elements below the main diagonal are equal to 0. This means that all elements in the lower part of the array, including the diagonal itself, have a value of 0.
14.
Dalam Array Lower Tringular dengan 4 baris, total elemen <> 0 tidak lebih dari:
Correct Answer
B. 6
Explanation
In a lower triangular array with 4 rows, the total number of elements that are not equal to 0 is 6.
15.
Array yang sangat banyak elemen nol-nya, dikenal sebagai
Correct Answer
C. Sparse array
Explanation
A sparse array is an array that has a large number of zero elements. This means that most of the elements in the array are empty or not used. In contrast, an upper triangular array and a lower triangular array are specific types of multidimensional arrays where the elements above or below the main diagonal are zero, respectively. Therefore, the correct answer is sparse array.
16.
Untuk mengolah data yang banyaknya tidak bisa ditentukan sebelumnya, maka disediakan satu fasilitas yang memungkinan untuk menggunakan suatu perubah yang disebut dengan
Correct Answer
A. Peubah dinamis
Explanation
Untuk mengolah data yang banyaknya tidak bisa ditentukan sebelumnya, salah satu solusinya adalah dengan menggunakan peubah dinamis. Peubah dinamis memungkinkan kita untuk mengalokasikan memori secara dinamis saat program berjalan, sehingga kita dapat menyesuaikan ukuran data sesuai kebutuhan. Hal ini berbeda dengan peubah statis yang memerlukan penentuan ukuran sebelum program dijalankan. Array dan struct juga merupakan jenis peubah, namun keduanya memiliki ukuran yang tetap dan tidak bisa diubah saat program berjalan.
17.
Pada deklarasi: int x,y,*z, isi variabel z adalah:
Correct Answer
A. Alamat memori
Explanation
The variable z is declared as a pointer, which means it will store the memory address of another variable. Therefore, the correct answer is "Alamat memori" which translates to "Memory address" in English.
18.
Suatu kumpulan komponen yang disusun secara berurutan dengan bantuan Pointer disebut:
Correct Answer
A. Linked list
Explanation
A linked list is a data structure in which a group of components are organized sequentially using pointers. Each component, called a node, contains a data element and a pointer that points to the next node in the list. This allows for efficient insertion and deletion of elements in the list, as well as dynamic memory allocation. Unlike arrays, linked lists can grow or shrink in size during program execution. Therefore, a linked list is the correct answer for a group of components arranged sequentially with the help of pointers.
19.
Setiap simpul dalam suatu Linked List terbagi menjadi dua bagian, yaitu
Correct Answer
A. Medan data dan medan penyambung
Explanation
Setiap simpul dalam suatu Linked List terbagi menjadi dua bagian, yaitu medan data dan medan penyambung. Medan data menyimpan nilai atau informasi yang ingin disimpan dalam simpul, sedangkan medan penyambung menyimpan alamat atau referensi ke simpul berikutnya dalam Linked List.
20.
Deklarasi Node :
typedef struct TNode{
int data;
TNode *next;
};
Pernyataan yang salah yaitu:
Correct Answer
D. TNode adalah variabel
Explanation
The given statement that is incorrect is "TNode adalah variabel" (TNode is a variable). TNode is not a variable, but a struct type that is used to define a structure for creating nodes in a linked list. It is used to create instances of nodes, which can then be linked together using the "next" field to form a linked list.
21.
baru->data = databaru;
baru->next = NULL;
Pada deklarasi di atas, perintah NULL artinya
Correct Answer
B. Tidak ada simpul berikutny
Explanation
The correct answer is "tidak ada simpul berikutny". In the given code snippet, the statement "baru->next = NULL" assigns the value of NULL to the "next" field of the "baru" node. This indicates that there is no next node connected to the "baru" node, implying that there are no more nodes in the linked list after it.
22.
Berikut operasi pada linked list, kecuali:
Correct Answer
D. Menambah linked list
Explanation
The given options represent operations that can be performed on a linked list. The options "menambah simpul" (adding a node), "menghapus simpul" (deleting a node), and "membaca simpul" (reading a node) are valid operations that can be performed on a linked list. However, the option "menambah linked list" (adding a linked list) is not a valid operation. Adding a linked list would involve merging two linked lists, which is not a standard operation on a linked list.
23.
Jika Head = Tail = Null, maka kondisi Linked List adalah :
Correct Answer
A. Kosong
Explanation
The given condition "Head = Tail = Null" implies that both the head and tail of the linked list are null. This means that there are no elements in the linked list, making it empty.
24.
Pada saat awal, Top of Stack selalu bernilai
Correct Answer
B. -1
Explanation
The correct answer is -1. This is because in the initial state, the top of the stack is always set to -1. This indicates that the stack is empty and there are no elements in it. As elements are pushed onto the stack, the top of the stack will be incremented accordingly.
25.
Prinsip stack yaitu
Correct Answer
C. Last in first out
Explanation
The correct answer is "last in first out." This principle refers to the order in which elements are accessed or removed from a stack data structure. In a last in first out (LIFO) stack, the last element that is added to the stack is the first one to be removed. This means that the most recently added element is always at the top of the stack and is the first one to be accessed or popped off the stack.