Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Name: Askal Thapa

Assignment: Week-3

1. Write a Count() method that contains the # of items a given integer occurs in a list.
Your solution must be in O(n).
2. Write a method to return the total number data items present in a list(length of a
linked-list).
3. Write a getNth method that takes a linked list & an integer-index & returns the data
value stored in the node at that index.
4.
Write a sortedInsert() method which goven a list that is sorted in increasing order,
and a single nod, inserts the node into the correct sorted position in the list.
5. Write a method, removeDuplicates(), which removes the duplicate items from the
sorted linked-list.

You might also like