Programming I - Labs 2018/2019
This page contains materials for the practice lessons of the Programming I (NPRG030) course that is being/has been taught during winter semester 2018/2019 at Charles University in Prague, Czech Republic. The course official web page is/was to be found at Tomáš Holan's webpage. The practice lessons (labs) are/were backed by many, for this group, concretely, by Jakub Gemrot
Tuesday's labs, 14:00, SW2, Jakub Gemrot: firstname.lastname@example.org
VisuAlgo - visualization of algorithms including AVL trees!
How to pass the labs
- Max TWO absences
- Do ALL homeworks I give you
- Almost no excuses here, it has very good motivation I('ll) share during the first lab
- Pass a lab exam
- Two dates: 18. 12. 2018 / 8. 1. 2019
- Come up with an individual semester project
- Deliver a semester project
- Delivery deadline: “up-to-you” = to be negotiated :)
- Apart from the implementation you will also have to create user's manual and programmer's manual
- Follow delivery guidelines when submitting your work
Send me an email (email@example.com) containing a link where I can download your homework / project.
Always use subject: PRG1 - 2018 - L[lab number] - [homework name]
The subject is crucial! My mailbox is often overflowing and I have to process emails in batches - at these times, I'm searching for your homeworks via subject names.
- Dynamic Trees, Binary Search Trees, definitions and implications
- PRG1 - 2018 - L10 - BST
- Create a program that will load integer numbers into the binary search tree dynamic structure
- Pretty print the result binary tree
- Fibonacci numbers, Factorial, Tower of Ha-noi, Quicksort
- No homework
- Dynamic variables, new/dispose, linked lists
- Homework in the ReCodEx group (Big Numbers / Fakt dlouhá čísla)
- Arrays in Pascal, user types, record, passing the data via value and reference (var)
- Homework in the ReCodEx group (Train and the Bridge / Po mostě má přejet vlak)
- We have been talking about functions building chain of functions and reusing them, showing the result of function signature changes and how to work around it
- Tasks we have been working on, using only functions chr(x) and ord(x)
- Is this input a natural number (0 included)?
- Does this string contain a natural number (0 included)?
- Does this string a whole number?
- PRG2 - 2018 - L06 - Strings - 4 programs; deliver them as functions
- How many digits this whole number stored in a string is containing? Return -1 if the string does not contain a whole number.
- What is the sum of digits in this whole number stored in a string? Return -1 if the string does not contain a whole number.
- You are given a string that should contain a whole number; return the number without its first digit. Return 0 if the string does not contain a whole number or the number contains only single digit.
- You are given a string, return the same string but convert all lower-case characters into their upper-case variants.
- This exercise has been experimentally assigned to your group in ReCodEx, try to solve this by submitting your solution through ReCodEx!
- We've been going through the 22 small programs and then we will be talking about string handling, procedures and functions
- We touched string functions and procedures in Pascal
- Examples here: stringy.pas
- So we have presented correct lower-estimate for sorting algorithms based on comparison of two numbers, yep O(N log N) is the best we can hope for
- But only for a given assumptions, see Counting Sort, for small range of natural numbers, you can have sort with time complexity O(N)! But it's not working in-place, what a pity.
- Then I've been showing Pascal language, some bits of Lazarus, and we have a homework!
- PRG1 - 2018 - L04 - Small Programs
- Solve the following 22 problems (programs) with a Pascal program
- If you are an expert, try to solve them with the least number of variables possible ;)
- Deadline: next lab… we need to decide when that is going to be
- WARNING: 30.10. - immatriculation, 6.11. - Dean's day, 13.11. - I'm in Canada ;(
- We talked about time complexity of algorithms, we touched Big-O notation (Landau Notation)
- I've failed to show you the correct computation of the lower bound for sorting, which we will fix next week
- No homeworks folks! Yay! Finish the ones from previous weeks
- We did some mind-troubling puzzles again :)
- PRG1 - 2018 - L02 - Install Pascal
- PRG2 - 2018 - L02 - Glasses
- Solve the following problem Wizard & Prisoner - Glasses problem and send me the solution
- PRG2 - 2018 - L02 - River
- Solve the following problem River in the park and send me the solution
- Deadline: 15.10.2018 23:59
- Welcome to Programming!
- Some introductory formal / informal info
- First batch of homeworks :)
- PRG1 - 2018 - L01 - Login
Go to SISAL and create an account for the lab
- NEW: test that you can login to some computer in Rotunda using your CAS (SIS) credentials
- Send me an email with you CUNI number and login to ReCodEx
- PRG1 - 2018 - L01 - Prisoners
- Solve the following problem, Prisoners, and ideally (but optionally) prove that your solution is working
- PRG1 - 2018 - L01 - Coins
- Solve the following problem, Wizard & Prisoner - Coins, in a way that the description also serves as a proof that your algorithm is working
- Deadline: 8.10.2018 23:59