На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
! Следующие правила действуют в данном разделе в дополнение к общим Правилам Форума
1. Здесь обсуждается Java, а не JavaScript! Огромная просьба, по вопросам, связанным с JavaScript, SSI и им подобным обращаться в раздел WWW Masters или, на крайний случай, в Многошум.
2. В случае, если у вас возникают сомнения, в каком разделе следует задать свой вопрос, помещайте его в корневую ветку форума Java. В случае необходимости, он будет перемещен модераторами (с сохранением ссылки в корневом разделе).

3. Запрещается создавать темы с просьбой выполнить какую-то работу за автора темы. Форум является средством общения и общего поиска решения. Вашу работу за Вас никто выполнять не будет.
4. Не рекомендуется создавать несколько несвязанных вопросов в одной теме. Пожалуйста, создавайте по одной теме на вопрос.
Модераторы: dark_barker, wind
  
> Задачи на Алгоритмы. Решение. Покритикуйте
    Задачи на Алгоритмы. Решение. Покритикуйте
    Цитата

    Problem 1.
    Given array a of N elements transpose it as follows
    {a[N-1], a[N-2],…, a[0]}
    Memory consumption (not including the space for array) – O(1)
    Running time – O(N)

    Problem 2.
    Given sorted arrays a of n elements and b of m elements produce sorted array c of n+m elements that consists of all elements from arrays a and b.
    Program reads and stores the arrays in files a, b and c one number per line.
    Memory consumption – O(1)
    Running time – O(n+m)

    Problem 3.
    The following function double rand() returns a random floating point number evenly distributed over interval [0;1).
    Write an expression (or a function) that returns
    a) a random integer N so that 7 <= N <= 23
    b) a random number N from set {3.5, 4.5, 5.5, …, 13.5}
    c) a random string from set { “asdf”, “a”, “jkl;”, “cc”, “zaxd” }

    Problem 4.
    Given array a of N (N > 1) elements and integer K (0 < K <= N-1) transpose the array as follows
    {a[K], …, a[N-1], a[0],…, a[K-1]}
    Memory consumption (not including the space for array) – O(1)
    Running time – O(N).

    What data structure(s) can be used to implement the mini-framework for this problem effectively?

    Problem 5.
    Write a program that prints all permutations (in any order) of sequence {1, 2, 3, …, N}.
    Hint: there are N! permutations.

    Problem 6.
    Write a program that takes a string as a parameter and prints out all substrings of the following format: <tag>some text</tag>.
    Here ‘tag’ can be any alphanumeric character string.
    The input string is assumed not to have nested tags.
    Hint: regular expressions should be used for string matching

    What updates will be required in your program in case of nested tags?

    Код решения наиболее последней версии тут:
    AlgorithmsSolver - класс алгоритмов
    AlgorithmsStarter - класс для запуска

    Скачать дополнительно:
    a.txt – используется в Problem 2, предполагается нахождение в корне C:\
    b.txt – используется в Problem 2, предполагается нахождение в корне C:\
    combinatoricslib-2.0.jar – используется в Problem 5
    commons-io-2.4.jar – используется в Problem 6
    nested_tags.html – используется в Problem 6, предполагается нахождение в корне C:\
    0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
    0 пользователей:


    Рейтинг@Mail.ru
    [ Script execution time: 0,0153 ]   [ 15 queries used ]   [ Generated: 2.05.24, 15:06 GMT ]