Professional Documents
Culture Documents
Tut - 03 - 020843
Tut - 03 - 020843
● Node class
Section 3
● Practice Problems
Intersection of 2 LL https://leetcode.com/problems/intersection-of-two-linked-lists/
● Sheet 3
● Modify the selection sort to be used for a linked list.
Section 3
● Sheet 3
● Modify the selection sort
to be used for a linked list.
Section 3
● Sheet 3
● Bubble sort is based on swapping the consecutive arrays contents when they are
not in order, is this sort method suitable for a linked list version than selection sort?
Discuss
Section 3
● Sheet 3
● Bubble sort is based on swapping the
consecutive arrays contents when
they are not in order, is this sort
method suitable for a linked list
version than selection sort? Discuss
Section 3
● Sheet 3
● Bubble sort is based on swapping the
consecutive arrays contents when
they are not in order, is this sort
method suitable for a linked list
version than selection sort? Discuss
Section 3
● Sheet 3
● A linked list is used to hold coefficients of a polynomial; the most significant
coefficient is in front, The linked list P(x) = 4*x^3 + 2*x^2 -1 will look like,
P(5) = 4*125 + 2*25 -1 = 500+50-1=549
Create a C++ class to implement such an application and in your class show how to
perform the following tasks in OO fashion as much as possible:
a. Construct a polynomial linked list from an array values
b. Multiply two polynomials together and the result will be a new polynomial
c. Evaluate a polynomial with a value x in the best big O
d. Differentiate the polynomial with respect to x i.e. dP(x)/dx
Section 3
● Sheet 3
● You are given a large number of coins 1024, one of them is faked and lighter than
the rest, the shape of the coin is identical to the rest of the coins. Given a scale, plan
how to discover the faked coin in the minimum number of scale uses.
Write a function in c/java to simulate the process the function takes a parameter n
which is the size of the coins under current test.
Section 3