Skip to content
VUBuddy

CS521 Final Term Notes Set 2

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

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, 2, 3 of 14. Download the file for all 14 pages.

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

Big-O

Small-o

Big-

(non-negative constant) Small-

Big-

(some constant)

Notes:

Some hierarchies: ( is “o”, is “ ”)

Divide and Conquer – recurrences:

Break a problem into sub-problems, solve sub problems and merge solutions. Hanoi-tower: ( ) ( ) ( )

Solving Recurrences:

1. Substitution method:

Have a guess for ( ) Assume correctness for all Substitute -terms in the recurrence by the assumption, using constants, and derive upper / lower bounds (or both). Example:

To get an upper bound: ( ) ( ) – develop and derive an expression that is exactly .

2. Recursion tree:

Build a tree from the levels in the substitution: Level 0: ( ) Level 1: elements, each costs ( )

Level : elements, each costs ( ) Last level: elements , each costs ( )

3. The Master Theorem:

For , ( ) function over non-negative integers and ( ) the recurrence:

  1. ( ) ( ) ( ) ( )
  2. ( ) ( ) ( ) ( )
  3. ( ) ( ) and ( ) ( ) ( ) ( ( ))

Notes for MT: The addition/subtraction denotes polynomial difference in running time between ( ) and . Cases (1) and (2) derive for some relation between . Simplified Master Theorem: For ( ) ( ) ( ) :

  1. ( ) ( )
  2. ( ) ( )
  3. ( ) ( )

Some recurrences:

Binary search: ( ) ( ) ( ) Linear search: ( ) ( ) ( ) ( ) ( ) ( ) (MT case 1) ( ) ( ) ( ) (tree) ( ) ( ) √ ( ) (MT case 3) ( ) ( ) ( ) (bounds) ( ) ( ) ( ) (tree) ( ) ( ) ( ) ( ) ( ) (bounds) ( ) ( ) ( ) (substitution) ( ) ( ) ( ) (bounds) ( ) ( ) ( ) (bounds) ( ) √ (√ ) ( ) ( ) (tree)

Useful math:

Harmonic series: ∑ when

Sorting algorithms:

Insertion Sort:

Each element is pushed as far as possible to the left (sorted) part of the array. Running time: ( ) worst-case (when sorted in reverse), ( ) best-case (when already sorted). Sorts in-place, space complexity: ( ).

Merge-sort:

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

Quick Sort:

Partition( ): linear procedure that partitions in-place around , - s.t.: | | and returns the index of

  • the pivot.

Preferable over merge-sort, as it sorts in-place. General recurrence: ( ) ( ) ( ) ( ) Worst-case: array already sorted, partition at the beginning: ( ) ( ) ( ) ( ) For any -proportional division we get ( ):

For we get a balanced tree. Expected running time: , ( )- ∑ , - ( | ) Heap: Left filled structure that satisfies partial order (node its children, no particular relation between children). For node : left child at , right at , parent ⌊ ⌋ Height is : the cost of insertion, extract-max, delete. Every level of height has ⌈ ⌉ nodes.

Insert: put node at the end and heapify up (switch with parent( ) until parent( ) or is root. 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 down to , heapify down. Amortized analysis – each level but lowest will be visited at most ( ) . Total: ( ) ∑ . The sum part is ( ) total: ( ).

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.