CPE102 – SORULAR (Solution)

$ 20.99
Category:

Description

1. Klavyeden -1 girilene kadar verilen tek sayıları tek bağlı doğrusal bir listenin başına, verilen çift sayıları ise listenin sonuna ekleyen programı yazınız.
Adding the odd numbers to the beginning of the list and even numbers to the end of the list until -1 is entered from keyboard.
struct node { int number; struct node * next;
};

2. Bir bağlı doğrusal listelerde listenin sonundaki düğümü keserek listenin başına ekleyen ve oluşan listenin son halini geri döndüren prototipi aşağıda verilmiş fonksiyonu yazınız.
A singly linear list stores integer values in each node and has multiple nodes. Write a function using given prototype below. This function cuts the last node of the list and adds it to the beginning as first node. It takes beginning address of the list as a parameter and returns the updated list.
struct node* cutlastaddhead(struct node* head); struct node { int number; struct node * next;
};

3. Bir bağlı doğrusal listelerde listenin ortasında yer alan elemanı silen (tuttuğu alanı belleğe geri iade eden) bir fonksiyon yazınız (Liste 100 ya da 101 elemanlı ise 50. elamanı silecek şekilde). Fonksiyon parametre olarak bir liste alıp güncellenen listeyi geri döndürecektir.
(In a linear linked list, write a function that deletes the element in the middle of the list (free this memory location) (if the list has 100 or 101 elements, it will delete the 50th element). The function will take a list as a parameter and return the updated list.)

4. Bir bağlı doğrusal listelerde listenin sonundaki düğüm ile başındaki düğümün yerini değiştiren changeFirstAndLast isimli bir fonksiyon yazınız. Fonksiyon parametre olarak bir liste alıp güncellenen listeyi geri döndürecektir.
(In a linear linked list, write a function named changeFirstAndLast that swaps the node at the end of the list and the node at the beginning of the list. The function will take a list as a parameter and return the updated list.)

5. Bir bağlı doğrusal listelerde listenin başındaki düğümü keserek listenin sonuna ekleyen ve oluşan listenin son halini geri döndüren prototipi aşağıda verilmiş fonksiyonu yazınız.
A singly linear list stores integer values in each node and has multiple nodes. Write a function using given prototype below. This function cuts the first node of the list and adds it to the end as last node. It takes beginning address of the list as a parameter and returns the updated list.
struct node* cutheadaddlast(struct node* head); struct node { int number;
struct node * next;
};

6. Klavyeden -1 girilene kadar verilen çift sayıları tek bağlı doğrusal bir listenin başına, verilen tek sayıları ise listenin sonuna ekleyen programı yazınız.
Adding the even numbers to the beginning of the list and odd numbers to the end of the list until -1 is entered from keyboard.
struct node { int number; struct node * next;
};

7. Kendisine parametre olarak aktarılan head isimli liste ve age yaş parametresine göre işlem yapan fonksiyon, listedeki age yaş değerine sahip ikinci düğümü bularak silmektedir (bu düğümü belleğe iade etmekte). Aşağıda verilen prototipi kullanarak gerekli fonksiyonu yazınız.
Write a function that takes two parameters head (list name) and age (given student age). The function deletes node (free this memory location) by finding the second node with the given age value in the list. Write the required function using the prototype given below.
node* deleteNode(node*, int);

8. Bir bağlı doğrusal listelerde listenin sonundaki düğüm ile başındaki düğümün yerini değiştiren changeFirstAndLast isimli bir fonksiyon yazınız. Fonksiyon parametre olarak bir liste alıp güncellenen listeyi geri döndürecektir.
(In a linear linked list, write a function named changeFirstAndLast that swaps the node at the end of the list and the node at the beginning of the list. The function will take a list as a parameter and return the updated list.)

Reviews

There are no reviews yet.

Be the first to review “CPE102 – SORULAR (Solution)”

Your email address will not be published. Required fields are marked *