C program, urgent help req, linked list?
-
(a) define using typedef a type suitable for each element of the list of integers – let us call it LISTEL, (b) define a suitable data type for the list – let us call it LIST (Hint: Obviously it would be of type pointer to LISTEL), (c) write a C function for each of the following operations on the object LIST: i. LIST construct (), which returns an empty list, ii. short int is empty (LIST), which returns 1 if the passed list is empty and 0, otherwise, iii. LISTEL head (LIST) which is to return the first element of the list; the input list does not get disturbed, iv. LIST tail (LIST) which returns the tail of the list, i.e., the original list with its head (i.e., the first element) removed, v. void printList (LIST) which prints the input list elements, vi. LIST concat (LIST, LIST) which concatenates the second list at the end of the first list, vii. LIST insert (LIST, int, int) – inserts the second parameter at a position in the list designated by the third parameter and returns the new list ; note that when the third parameter is 1 the pointer to the first element itself gets changed but this is taken care of by having the datatype LIST itself as a pointer and having the function return this new pointer value to the calling function which can be assigned to the original pointer variable. However, here also you would gain in terms of uniformity if you use a dummy element at the beginning. viii. LIST reverse (LIST), a recursive function which returns a list which is the reverse of the input list. ix. LIST alternate (LIST, LIST) which takes two lists and returns a new list having elements chosen from the two lists alternatively; thus, in the new list, the first one will be the first element of the first list, the second one will be the first one of the second list, and so on. The original lists are left undisturbed. x. Write a main function to demonstrate the working of the above functions.
-
Answer:
Sorry. You have to do and ask us for help.
Prateek K at Yahoo! Answers Visit the source
Other answers
Sorry. You have to do and ask us for help.
James Bond
i can do it, if u can pay me
Abdul Nawaf
i can do it, if u can pay me
Abdul Nawaf
Related Q & A:
- how to draw circular doubly linked list?Best solution by TeX - LaTeX
- How Can I use .net dll in C program?Best solution by Stack Overflow
- How to run an executable from within a c program?Best solution by Stack Overflow
- I want to download full encyclopedia program, please help.Best solution by Yahoo! Answers
- Can anyone help me with this C++ program?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.