The C Language programming course known as "Programming 2" at the University of Ljubljana, Faculty of Computer and Information Science
Professor Dr. Boštjan Slivnik
All the code is in C.
This course is known as the hardest course out of the ten courses in the first year at the Faculty, with a passrate of around 35% every year, meaning 65% of students fail the class each Academic year.
Every task with a working makefile and test units can be tested using the following sequence of commands:
gcc -o FileName FileName.c
export name=FileName
make test
You can also run the program manually using the following sequence of commands:
gcc -o FileName FileName.c
./FileName
Control Constructs I - Week 1
- Sum modulo: Write a program that reads numbers a and b and outputs their sum modulo 10
- All equal: Write a program that reads a number n and n more numbers, and then outputs 1 if all of the n numbers are equal to each other, and 0 if this is not the case.
- Second largest: Write a program that reads a number n and n more numbers, and then outputs the second largest among those n numbers. If there are multiple numbers that are the largest, the second largest number is equal to the largest number.
Control Constructs II - Week 2
- Pythagorean Threes
- Optimal Guessing
Functions - Week 3
- Friend Numbers
- Lychrel Numbers Manipulation
Arrays - Week 4
- Permutation variants of an array
- Biggest sum of sub-array in an array
Arrays, Pointers, Sequences I - Week 5
- Function Sum
- Function IndexAndPointer
- Function FrequencyOfLetters
Arrays, Pointers, Sequences II - Week 6
- Function NumberOfCharacters
- Function CopyStringUntilCharacter
- Function StringSegmentation
Recursion I - Week 7
- Number of Possible Recursive Combinations [With explanation in comments of the code]
- [Additional video explanation of solution at 11:09]
- List of Possible Recursive Combinations [Logic is explained in the comments of the task above]
- Hanoi Towers - Explanation Video
- Steps to solve any recursive problem [21 min]
- Recursion Explanation #1 [5 min]
- Recursion Explanation #2 [Full Course] [2 hr]
- Recursion Explanation #3 [C] [10 videos]
Recursion II - Week 8
- Maximum price of N unique items of C price in V space (Knapsack problem)
- Knapsack using Recursion - Explanation Video [19 min]
- Knapsack using Two Methods - Explanation Video [Abdul Bari] [29 min]
- Knapsack with max K items with odd volume
Recursion III - Week 9
- All Possible Lexicographical Strings of [1,N] length between two characters
- Partitions of a set
Structures - Week 10
- Function findStudent
- Function findIfStudentHasSubject
- Function Enrichen
Linked Lists - Week 11
- Iterative implementation of function SumOfLinkedList function
- Recursive implementation of function SumOfLinkedList function
- Iterative implementation of InsertElementInAscendingSortedLinkedList function
- Recursive implementation of InsertElementInAscendingSortedLinkedList function
Text Files - Week 12
- Copy longest line from a file to a new file containing only said line
- Merge N number of files with an ascending list of numbers into one single file with all the numbers together in ascending order
Binary Files - Week 13
- Color of a dot
- Transformation into grays
- Control Constructs I - Week 1
- Control Constructs II - Week 2
- Functions - Week 3
- Arrays - Week 4
- Arrays, Pointers, Sequences I - Week 5
- Arrays, Pointers, Sequences II - Week 6
- Recursion I - Week 7
- Recursion II - Week 8
- Recursion III - Week 9
- Structures - Week 10
- Linked Lists - Week 11
- Text Files - Week 12
- Binary Files - Week 13
2018
- 2018 - 1st Midterm A - 2nd task
- 2018 - 1st Midterm B - 2nd task
- 2018 - 2nd Midterm A - 1st task
- 2018 - 2nd Midterm B - 1st task
2019
- 2019 - 1st Exam - 1st task
2022
- 2022 - 1st Exam - 1st task
- 2022 - 1st Exam - 3rd task
- 2022 - 1st Exam - 1st task [Online Exam version]
- 2022 - 1st Exam - 2nd task [Online Exam version]
- 2022 - 1st Exam - 3rd task [Online Exam version]
- 2022 - 2nd Exam - 1st task
- 2022 - 2nd Exam - 2nd task
- 2022 - 3rd Exam - 1st task
- 2022 - 3rd Exam - 2nd task
- 2022 - 3rd Exam - 3rd task
2023
- 2023 - 1st Midterm A - 1st task
- 2023 - 1st Midterm A - 2nd task
- 2023 - 1st Midterm A - 3rd task
- 2023 - 2nd Midterm A - 1st task
- 2023 - 2nd Midterm A - 2nd task
- 2023 - 2nd Midterm A - 3rd task
- 2023 - 2nd Midterm B - 1st task
- 2023 - 2nd Midterm B - 2nd task
- 2023 - 2nd Midterm B - 3rd task
- 2023 - 1st Exam - 1st task
- 2023 - 1st Exam - 2nd task
- 2023 - 1st Exam - 3rd task
- 2023 - 2nd Exam - 1st task
- 2023 - 2nd Exam - 2nd task
- 2023 - 2nd Exam - 3rd task
The files for the 3rd exam of 23/24 are available as well.
- Pass the subject (Grade: 8)