إعـــــــلان

تقليص
لا يوجد إعلان حتى الآن.

Plz help me with the following problem, I will be very thankful to you..

تقليص
X
 
  • تصفية - فلترة
  • الوقت
  • عرض
إلغاء تحديد الكل
مشاركات جديدة

  • Plz help me with the following problem, I will be very thankful to you..


    Some guide lines for the assignment two

    • Use Eclipse platform to write and run the program.
    • Submit a soft-copy of the program code through SFDV3001 Data Structures1 Assignment Two (5 marks)
    Each student will answer one question only which will be selected by the academic staff randomly.

    Problem A: Counting
    Complete the function TotalChars. TotalChars returns the total number of occurrences of the character ch in each string in list. You should use the string member function to find the number of characters in a string and s[k] for the value of the kth character (indexing starts at 0).

    e.g. information technology : i=2, n=3, f=1, o=4, r=1, m=1, a=1, t=1, e=1,
    c=1, h= 1, l= 1, g=1, y=1
    You should write this function either recursively or iteratively (non-recursively).

    Problem B: Replicate
    Write the function Replicate. Replicate adds new nodes to list so that nodes are replicated the number of times specified by parameter count. For example, if list is represented by:
    ("apple","cat","xray")
    Then the call Replicate(list,3) should change list as shown below.
    ("apple","apple","apple","cat","cat","cat","xray", "xray","xray")

    Problem C: Reverse
    Complete the function Reverse. Reverse reverses the nodes of its parameter list. In writing Reverse you should maintain as an invariant. This invariant would be initialized by the statement: rev = NULL, where rev, since initially no nodes have been reversed and all nodes need to be reversed. Your code will run in O(n) time for an n-node list if you do this correctly.


    Problem D: Split
    Write a function ListSplit that will split a circular list containing an even number of nodes, say 2k, into two circular lists each of which contains k nodes. The function should have three parameters and should work so that the function call
    ListSplit(list,sub1,sub2);
    will create new lists linked to by parameters sub1, and sub2 from the list initially referenced by parameter list. After ListSplit has executed, the first parameter should be 0/NULL, i.e., new nodes are not created, but are redistributed evenly between the second and third parameters. It doesn't matter how you divide the nodes between the two lists. Note that you should make no assumptions about the values of first and second in the body of ListSplit.
يعمل...
X