Skip to main content
EDU-MMCS
You are currently using guest access (Log in)

CS211 C++, Programming languages

  1. Home
  2. Courses
  3. Осенний семестр
  4. Фундаментальная информатика и ИТ
  5. CS211 C++ ENG
  6. General
  7. Difficult tasks

Difficult tasks

Completion requirements
Opened: Tuesday, 1 September 2020, 12:00 AM

Some difficult tasks will be added here.

  1. (vector | array) Remove all odd elements from the given vector by shifting the remaining elements to its beginning.

Project "Normal Algorithms"

Description of the subject area:

1.A normal substitution is a pair of strings S, P together with a final flag. A substitution is said to be applicable to a given string X if S is a substring of it. Substitution is applied to string X by replacing the first occurrence of the substring S with P.

2.A normal algorithm scheme is a normal permutation vector.

3.A normal algorithm step is the application of an algorithm scheme to a given string according to the following rules:

  • The first substitution applicable to the string is found.
  • The substitution found is applied to the string.

4.A normal algorithm is a multiple repetition of the steps of a normal algorithm. The execution of the algorithm ends in the following cases:

  • Final substitution applied (substitution with the final flag set).
  • None of the schema substitutions apply to the current row.

Examples:

1.Let there be a schema {{"ab", "", false}, {"a", "b", false}}. As a result of its application to the word aababab, we get the following chain of transformations: aababab ==> aabab ==> aab ==> a ==> b. The first three steps of the normal algorithm consist of applying the first substitution, and in the fourth step, the second substitution is applied (the first is no longer applicable). The fourth step turns out to be the last, since after it none of the substitutions is applicable (the first case of completion of the normal algorithm).

2.Scheme {{"b", "a", true}, {"a", "b", false}} on line aaa gives: aaa ==> baa ==> aaa. In the second step, the first (final) substitution is applied, so the normal algorithm ends.

The task:

1.Describe a structure for storing normal substitution.

2.Define a function that applies a given normal algorithm scheme (substitution vector) to a given string using helper functions.

3.Check the operation of the function using the above examples and several of your own.

4.Check what happens when the schema {{"a", "b", false}, {"b", "a", false}} is applied to the string "aabb".


  1. (lists | files) In a text file there is an information about  the results of the student exams. The info contains the last name, first name, and mark in 5 subjects for each student . There are no more than 20 students in a group.

Write a program that provides the following information:

  • list of students (full name);
  • list of students who passed all exams with 5 mark;
  • a list of students who have at least one 3 mark in exams;
  • a list of students who have 2 mark. If a student has more than one 2 mark, he is excluded from the list.

◄ Working with IDE (Visual Studio)
Rules ►
Skip Navigation
Navigation
  • Home

    • Site pages

      • My courses

      • Tags

    • My courses

    • Courses

      • Осенний семестр

        • Прикладная математика и информатика

        • Фундаментальная информатика и ИТ

          • Compiler Development

          • CMVSM

          • АЗПК

          • Frontend

          • ТеорЯП

          • Ruby Eng

          • EngCA&OS

          • CS201e

          • Компиляторы - лекции

          • CS202

          • CS211 C++ ENG

            • General

              • AssignmentWorking with IDE (Visual Studio)

              • AssignmentDifficult tasks

              • AssignmentRules

            • Module 1. Introduction

            • Module 2. Object-oriented programming

            • Recursion

            • Topic 4

            • Topic 5

            • Topic 6

            • Topic 7

            • Topic 8

            • Topic 9

            • Topic 10

        • Математика, механика

        • Педагогическое образование

        • Магистратура

          • Разработка мобильных приложений и компьютерных игр

        • Аспирантура

        • Вечернее отделение

        • Другое

      • Весенний семестр

        • Прикладная математика и информатика

        • Фундаментальная информатика и ИТ

        • Математика, механика

        • Педагогическое образование

        • Магистратура

          • Разработка мобильных приложений и компьютерных игр

        • Аспирантура

        • Вечернее отделение

        • Другое

      • Воскресная компьютерная школа

        • Пользователь компьютера плюс

        • Пользователь прикладных программ

        • Программирование I ступень

        • Программирование II ступень

        • Программирование III ступень

        • Архив

      • Воскресная математическая школа

        • Открытое тестирование РНОМЦ и мехмата ЮФУ - 2025

        • Олимпиадная математическая школа

        • Повышение квалификации

        • Доступная математика

        • Лаборатория математического онлайн-образования мех...

        • Осенняя универсиада

        • Научно-практическая конференция

        • ВМШ

          • ВМШ - 24

        • Летняя олимпиадная математическая школа РНОМЦ и ме...

      • Государственная итоговая аттестация

      • Дополнительное образование

      • Олимпиады

      • Видеолекции

      • Разное

      • Архив курсов

      • Заочная школа мехмата ЮФУ

Contact site support
You are currently using guest access (Log in)
CS211 C++ ENG
Data retention summary
Get the mobile app Яндекс.Метрика