Skip to content
VUBuddy

CS521 Final Term Notes

Web Systems and Technologies PDF 2.5 MBUpdated 23 Oct 2026
Final term past paper CS521 Final Term Notes PDF 2.5 MB
vubuddy.com
Type
Final term past paper
Course
CS521 Web Systems and Technologies
Size
PDF 2.5 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 2.5 MB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 3, 4 of 14. Download the file for all 14 pages.

√2 lg 𝑛 lg 𝑛 1/ lg 𝑛

Asymptotic Notations: · CS521 \ Notes for the Final Exam · Notation · Definition · Limit · Big-O

lim > 0

Small-o

lim

Big-Ω lim = 𝑐 ≥ 0

(non-negative constant)

Small-𝜔

lim = 0

Big-Θ lim = 𝑐

(some constant) · Notes: · Some hierarchies: (> is “o”, = is “Θ”)

lg 𝑛 > (√2) > 2

Divide and Conquer – recurrences:

Break a problem into sub-problems, solve sub problems and merge solutions.

Solving Recurrences:

1. Substitution method:

Substitute 𝑇-terms in the recurrence by the assumption, using constants, and derive upper / lower bounds (or

both). Example:

𝑛

𝑏

𝑏 𝑘=1

𝑘=0

Useful math:

𝑛 𝑛

Harmonic series: ∑𝑛

1 = Θ(lg 𝑛) 𝑛+1

Sorting algorithms:

Insertion Sort:

𝑛 (𝑞 −1) 𝑞−1 when 𝑛 = ∞∶ 𝑎

Each element is pushed as far as possible to the left (sorted) part of the array.

Running time: 𝑂(𝑛2) worst-case (when sorted in reverse), Ω(𝑛) best-case (when already sorted).

Merge-sort:

Divide the sequence into two 𝑛/2 sequences, apply the algorithm recursively and merge solutions.

Quick Sort:

𝑥 – the pivot.

Preferable over merge-sort, as it sorts in-place.

For 𝛼 = 2 we get a balanced tree.

and returns the index of

Heap:

Left filled structure that satisfies partial order (node > its children, no particular relation between children).

Height is lg 𝑛: the cost of insertion, extract-max, delete.

𝑛

Remove-max: remove root and put last node of the heap in its place. Heapify it down, each level switching with the greater child of the two until satisfies heap properties.

Build-heap: for node 𝑛/2 down to 1, heapify down. Amortized analysis – each level 𝑘 but lowest will be visited at most

Heap-sort:

Build a heap and then run ~𝑛 times: Swap the max with the last element, decrease heap size by 1 and heapify the new

root down. Result: the array is sorted.

Selection problems:

The Select algorithm for finding the 𝑖th o.s.:

Find the median for each group and store in 𝐴′.

𝑛

A general recurrence (for constants other than 5):

Calculate the minimal number of elements we know for sure are greater than 𝑥, the medians’ median.

Then we take the complement of that number:

𝑛 For any constant 𝑘 (the default in the selection algorithm is 𝑘 = 5), where we divide into ] ] sets, the 𝑘

number of elements that are definitely greater than 𝑥:

𝑛 𝑛 ] ]⌉ − 2) 𝑛 𝑛 − 2) ⇒

⏟2

˛_2 𝑘

2𝑘

The recursion over the complement is:

𝑛

𝑘 𝑛 ] · ( 𝑛 2𝑘

Then show by substitution that it is bounded / not bounded from above by 𝑐 · 𝑛 (would be bounded for any 𝑘 ≥ 4). Note that we get

Binary Search Trees:

Trees that satisfy: left(x) ≤ key(x) < right(x)

  • Left most leaf of 𝑥’s right subtree.
All CS521 files →
CS521 Web Systems and Technologies All CS521 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.