Uts Struktur Data

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Rakan
R
Rakan
Community Contributor
Quizzes Created: 1 | Total Attempts: 4,949
Questions: 25 | Attempts: 4,949

SettingsSettingsSettings
Uts Struktur Data - Quiz

Questions and Answers
  • 1. 

    Yang termasuk struktur data sederhana yaitu

    • A.

      Int, char, float, bool

    • B.

      Array dan struct

    • C.

      Tree

    • D.

      Linked  list

    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.

    Rate this question:

  • 2. 

    Type data dibawah ini, yang TIDAK termasuk dalam tipe data sederhana tunggal, adalah

    • A.

      Int

    • B.

      Float

    • C.

      Char

    • D.

      String

    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.

    Rate this question:

  • 3. 

    ==, <=, >=, !=, termasuk dalam operator

    • A.

      Aritmatika

    • B.

      Relasional

    • C.

      Boolean

    • D.

      String

    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".

    Rate this question:

  • 4. 

    Type data yang menghasilkan bentuk keluaran nilai True dan False (Benar dan Salah) , adalah

    • A.

      Int

    • B.

      Float

    • C.

      Bool

    • D.

      Char

    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.

    Rate this question:

  • 5. 

    1. void main()
    2.   {
    3.   ....  x,y,z;
    4.   clrscr();
    5.   cout <<“\n input nilai X=“; cin >> x;
    6.   cout <<“\n input nilai Y=“; cin >> y;
    7.   z = x + y;
    8.   cout <<“\n hasil penjumlahan =“ << z;
    9.   getch();
    10.   }
      tipe data yang tepat untuk mengisi titik-titik pada baris 3 adalah

    • A.

      Int

    • B.

      Float

    • C.

      Char

    • D.

      String

    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.

    Rate this question:

  • 6. 

    1. main()
    2.         {
    3.         int r = 10,s;
    4.         s = 10 +  ++r;
    5.         cout <<"r = "<< r << '\n';
    6.         cout <<"s = "<< s << '\n';
    7.         }
    Hasil eksekusi dari program diatas adalah ….

    • A.

      R = 11, s = 21

    • B.

      R = 10, s = 20

    • C.

      R = 11, s = 20

    • D.

      R = 10, s = 21

    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".

    Rate this question:

  • 7. 

    Yang bukan karakteristik array yaitu:

    • A.

      Statis

    • B.

      Dinamis

    • C.

      Random access

    • D.

      Homogen

    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.

    Rate this question:

  • 8. 

    Pada deklarasi:   int A[5][4][2], jumlah elemen pada array tersebut sama dengan:

    • A.

      11

    • B.

      40

    • C.

      60

    • D.

      80

    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.

    Rate this question:

  • 9. 

    Setiap elemen dari  sebuah Array haruslah mempunyai type data yang sama, termasuk dalam karakteristik array yaitu :

    • A.

      Statis

    • B.

      Terurut

    • C.

      Homogen

    • D.

      Dinamis

    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.

    Rate this question:

  • 10. 

    Array yang sering digunakan dalam menterjemahkan matriks pada pemrograman, adalah array berdimensi :

    • A.

      1

    • B.

      2

    • C.

      3

    • D.

      4

    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.

    Rate this question:

  • 11. 

    Contoh aplikasi array dimensi dua adalah

    • A.

      Input data suhu 

    • B.

      Input nama hari

    • C.

      Input nilai dan mata kuliah

    • D.

      Input nama bulan

    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.

    Rate this question:

  • 12. 

    Diketahui float A[5] dan lokasi awal terletak di alamat  00F(H), maka lokasi A[3] adalah

    • A.

      00FC

    • B.

      017

    • C.

      071

    • D.

      01B

    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.

    Rate this question:

  • 13. 

    Tringular Array dapat merupakan Upper Tringular ataupun Lower Tringular. Upper tringular Array, yaitu:

    • A.

      Seluruh elemen di bawah diagonal utama = 0

    • B.

      Seluruh elemen di bawah diagonal utama selain 0

    • C.

      Seluruh elemen di bawah diagonal utama = 1

    • D.

      Seluruh elemen di atas diagonal utama = 1

    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.

    Rate this question:

  • 14. 

    Dalam Array Lower Tringular dengan 4 baris, total elemen <> 0 tidak lebih dari:  

    • A.

      4

    • B.

      6

    • C.

      8

    • D.

      12

    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.

    Rate this question:

  • 15. 

    Array yang sangat banyak elemen nol-nya, dikenal sebagai

    • A.

      Upper tringular array array

    • B.

      Lower tringular array

    • C.

      Sparse array

    • D.

      Multidimensional array

    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.

    Rate this question:

  • 16. 

    Untuk mengolah data yang banyaknya tidak bisa ditentukan sebelumnya, maka disediakan satu fasilitas yang memungkinan untuk menggunakan suatu perubah yang disebut dengan

    • A.

      Peubah dinamis

    • B.

      Peubah statis

    • C.

      Array

    • D.

      Struct

    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.

    Rate this question:

  • 17. 

    Pada deklarasi: int x,y,*z, isi variabel z adalah:

    • A.

      Alamat memori

    • B.

      Data z

    • C.

      0

    • D.

      1

    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.

    Rate this question:

  • 18. 

    Suatu kumpulan komponen yang disusun secara berurutan dengan bantuan Pointer disebut:

    • A.

      Linked list

    • B.

      Stack

    • C.

      Array

    • D.

      Struct

    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.

    Rate this question:

  • 19. 

    Setiap simpul dalam suatu Linked List terbagi menjadi dua bagian, yaitu

    • A.

      Medan data dan medan penyambung

    • B.

      Medan penyambung dan medan alamat

    • C.

      Medan data dan medan informasi

    • D.

      Data field dan information field

    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.

    Rate this question:

  • 20. 

    Deklarasi Node :   typedef struct TNode{   int data;   TNode *next;   }; Pernyataan yang salah yaitu:

    • A.

      Field next bertipe pointer dari TNode

    • B.

      TNode terdiri dari 2 field

    • C.

      Field data bertipe integer

    • D.

      TNode adalah variabel

    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.

    Rate this question:

  • 21. 

      baru->data = databaru;   baru->next = NULL;  Pada deklarasi di atas, perintah NULL artinya

    • A.

      Field data diisi

    • B.

      Tidak ada simpul berikutny

    • C.

      Hapus data

    • D.

      Berisi data

    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.

    Rate this question:

  • 22. 

    Berikut operasi pada linked list, kecuali:

    • A.

      Menambah simpul

    • B.

      Menghapus simpul

    • C.

      Membaca simpul

    • D.

      Menambah linked list

    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.

    Rate this question:

  • 23. 

    Jika Head = Tail = Null, maka kondisi Linked List adalah :

    • A.

      Kosong

    • B.

      Penuh

    • C.

      Tidak dapat ditambah

    • D.

      Masih bisa diisi

    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.

    Rate this question:

  • 24. 

    Pada saat awal, Top of Stack selalu bernilai

    • A.

      0

    • B.

      -1

    • C.

      1

    • D.

      Maxstack-1

    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.

    Rate this question:

  • 25. 

    Prinsip stack yaitu

    • A.

      First in first out

    • B.

      Last in last out

    • C.

      Last in first out

    • D.

      Last in last out

    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.

    Rate this question:

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.