{"id":22153217,"url":"https://github.com/dpetrosy/saed_solved_problems","last_synced_at":"2025-03-24T13:42:28.333Z","repository":{"id":213260037,"uuid":"470060806","full_name":"dpetrosy/SAED_solved_problems","owner":"dpetrosy","description":"In this repository, I store my solved problems during my university education.","archived":false,"fork":false,"pushed_at":"2024-02-05T14:15:08.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T18:46:40.672Z","etag":null,"topics":["algorithms","bit-manipulation","cpp","cpp-templates","cpp11","modern-cpp","problem-solving","stl","university-course"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpetrosy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-15T08:05:55.000Z","updated_at":"2024-02-05T14:22:15.000Z","dependencies_parsed_at":"2025-01-29T18:42:30.467Z","dependency_job_id":"c45b433e-ba97-4af7-83d3-e40f98c47461","html_url":"https://github.com/dpetrosy/SAED_solved_problems","commit_stats":null,"previous_names":["dpetrosy/solved_problems","dpetrosy/saed_solved_problems"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpetrosy%2FSAED_solved_problems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpetrosy%2FSAED_solved_problems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpetrosy%2FSAED_solved_problems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpetrosy%2FSAED_solved_problems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpetrosy","download_url":"https://codeload.github.com/dpetrosy/SAED_solved_problems/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245283868,"owners_count":20590299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","bit-manipulation","cpp","cpp-templates","cpp11","modern-cpp","problem-solving","stl","university-course"],"created_at":"2024-12-02T01:17:32.817Z","updated_at":"2025-03-24T13:42:28.312Z","avatar_url":"https://github.com/dpetrosy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 📜 About Repository\n**SAED** stands for Synopsys Armenia Educational Department, the university where I received my bachelor's degree. \\\nIn this repository, I store my solved problems, which I have done as homework during SAED's C++ course.\n\n## 📑 Subjects\n\n1. Given a sorted `array[x]` of integers and the `f(x) = x^x` function, write a program that will produce a sorted `array[y]` with `y[i] = f(x[i])` elements in O(n) time.\n2. Write a program that will count the number of inversions in an array in O(nlogn) time.\n3. Given a NxN matrix, where N is a positive integer, write a program that will clockwise rotate the matrix 90 degrees. Write the non-in-place version using O(NxN) space.\n4. Write the in-place version for problem 3 using O(1) space. e.g: Input: n = 4, matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16. Output: 13 9 5 1 14 10 6 2 15 11 7 3 16 12 8 4.\n5. Given a string of words separated by spaces. Write an O(n) program to reverse the string. e.g: Input: \"abc ef\" Output: \"fe cba\".\n6. Write an O(n) program to reverse the words in a string. E.g., Input: \"abc defg hi klmn\". Output: \"klmn hi defg abc\".\n7. Define a Student structure containing the following fields: \"name\" for first and last names, \"group\" for group number and grades for an array of 10 subjects. Write a function that will input n students from the given stream and save them, sorted by the average of their grades.\n8. Write a program that will take an input string and prints the data of students from problem 07 whose first name ends with the given string letters.\n9. Given an n-sized array of non-negative integers, write a program that will arrange the elements in such a way that their concatenation will produce the largest possible number. The function should return the resulting number as a single string. Note: Since the concatenation may produce a larger integer than allowed, to avoid overflow, use `std::string`.\n10. Write a program that takes n and d integers as arguments, where d is necessarily a power of 2, and computes \"n modulo d\", namely the remainder, using bitwise operations, i.e. without % or /.\n11. Write a program that takes n and d integers as arguments and left-rotates n by d bits. Example: input: n = 16, i.e., (000...00010000)2; d = 2; output: 64, i.e., (000...01000000)2.\n12. Write a program that takes an integer and checks if it's a power of 4 in O(1).\n13. Write a program that takes n, p and r as integer arguments and swaps the bits of position p and r in n. Example: Input: n = 11, i.e. (0...01011)2, p = 1, r = 4; Output: 25, i.e. (0....11001)2.\n14. Extend the swapping program (problem 13) so that it takes the 4th integer q, indicating the number of bits to swap. Example: Input: n = 47, i.e., (00101111)2, p = 1, r = 5, q = 3. Output: 227, i.e. (11100011)2.\n15. Write a C-style variadic function that takes a string and a bunch of numbers and replaces each \"#\" symbol with a corresponding number. replace(\"aa# nn # cc## e\", 3, 12, -2, 1) should return \"aa3 nn 12 cc-21 e\".\n16. Solve problem 15 by using a variadic template.\n17. Write an optimal function that takes a positive integer n and returns the smallest power of 2 larger than n. Try to solve it using O(1) time complexity.\n18. Write a program using templates to calculate the factorial of the given number during compilation (compile time).\n19. Solve problem 18 using the constexpr function.\n20. Write a program using templates to calculate the Nth Fibonacci number during compilation (compile time).\n21. Implement a high-order function that multiplies two given numbers located in different parentheses. Use lambda expressions to solve this problem. Example: `mult(5)(8)` should return a value: 40.\n22. Solve problem 21 for five numbers, which are located in 5 different parentheses. Example: `mult(2)(7)(-8)(6)(3)` should return a value: -2016.\n23. Write a `saxpy()` function(SAXPY stands for “Single-Precision A * X + Y”) that takes three vectors and calculates an `result[i] = 2 * a[i] + b[i]` expression for each element of the resulting vector. Use CUDA to calculate SAXPY on the GPU.\n24. Write a function to find the middle node value in the linked list.\n25. Write a function to detect if there is a loop in the given list.\n26. Write a function that will reverse the doubly linked list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpetrosy%2Fsaed_solved_problems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpetrosy%2Fsaed_solved_problems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpetrosy%2Fsaed_solved_problems/lists"}