ALGORITHMS & ALGORITHMIC LANGUAGES (CENP2106)

Electrical and Electronic Engineering - EEE

Semester: First Semester

Level: 200

Year: 2017

The University of Bamenda
Coltech
Department of Computer Engineering
CA Algorithms and Programming Languages
Duration 1.5hrs
Exercise I (10 mks)
Write a pseudocode to compute iteratively
= n (n — 1) (n — 2) ... (np + 1)
where n and p are positive integers and p < = n.
Exercise II (5+5=10 mks)
a)
For the given vector B= <65, 87, 26, 15, 69, 47, 52, 31, 25, 6, 91, 5, 23> simulate the
sorting of B using quicksort algorithm.
b)
State the difference between direct and indirect recursion and discuss which one is
fast and has less memory consumption
Exercise III (3+3+4=10 mks)
You are given two linked list LI and L2. Each cell consists of an integer and a pointer on
the next cell.
a)
Write the C code to create a cell
b)
Write a C code to insert a cell after the 5
th
element of LI
c)
Let's suppose all the lists LI and L2 are being built. Write the pseudo code to merge
the 2 lists into list L3.
www.schoolfaqs.net