Printf("Students with NIM (%d) was found at index ", y, binarySearch_nim(mhs, size, y)) īuatlah program untuk pencarian data students berisi int nim, char nama dengan struktur linked list. Printf("Students with NIM (%d) not found", y) Printf("Students with name (%s) was found at index ", x, binarySearch_name(mhs, size, x)) Printf("Student with name (%s) not found", x) If (binarySearch_name(mhs, size, x) = -1) Int binarySearch_nim(struct dataMhs data, int size, int x) Int binarySearch_name(struct dataMhs data, int size, char x) Binary Search in Array Based on NIM and Name Pencarian berdasarkan nim Source Code Biner Struktur Array Printf("\n Do you want to continue? (Press 1 for 'Yes') = ") Printf("SEQUENTIAL SEARCH IN ARRAY LIST\n") Void display(struct dataMhs data, int size) Printf("Student (%s) with is not present in the array", x) Printf("Students (%s) with (%d) is present in the array at index ", x, data.nim, i 1) Int ordered_search_name(struct dataMhs data, int *size, char *x) Printf("Student with nim (%d) is not present in the array", x) Printf("Students (%s) with (%d) is present in the array at index ", data.name, x, i 1) Int ordered_search_nim(struct dataMhs data, int *size, int *x) Void fillData(struct dataMhs data, int *size) //fill data into array Sequential Searching in Array Based on Name and NIM Pencarian bisa dilakukan secara sekuensial atau biner dengan berdasarkan nim atau berdasarkan nama. Printf("Data (%d) was found at node ", x, ordered_search(x)) īuatlah program untuk pencarian data students berisi int nim, char nama dengan struktur array. false if a node is smaller than or equalįor (tmp = head tmp->next != NULL tmp = tmp->next)įor (tmp = head tmp->next != NULL tmp=tmp->next) tranverse the list till last node and return Return -1 //if the value we are looking for doesn't exist, return -1 P = (ptrnode)malloc(sizeof(struct node)) Sequential Search On Unordered Linked List Data Kasus data terurut menurun Source Code Struktur Array Printf("\nData (%d) was found at index ", x, ordered_search(data, size, x)) Printf("Input the data/value you want to search = ") if array list not in Ascending/Descending order this function have TRUE value when array is in descending order Void fillData(int data, int *size) //fill data into arrayīool checkDescending(int data, int size) #define MAX 100 //maximum size of array can be used Sequential Search On Unordered Array Data
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |