• Nie Znaleziono Wyników

Zestaw zada´n nr. 5: Listy (c.d.)

N/A
N/A
Protected

Academic year: 2021

Share "Zestaw zada´n nr. 5: Listy (c.d.)"

Copied!
1
0
0

Pełen tekst

(1)

Krak´ow 23.11.2017

Algorytmy i struktury danych I

Zestaw zada´n nr. 5: Listy (c.d.)

Zadania programoweprzygotowujemy w postaci kodu programu oraz dokumentu z kr´otkim opisem kodu oraz wynikami test´ow: plik.pdf (u˙zywamy latex, word) i umieszczamy w systemie Pegaz.

• Zadanie 1 (programowe) Uzupe lnij swoja

implementacje

listy oparta

o wska´zniki o metody doste

pne w biblotece STL dla listy class list. Mozesz u˙zy´c listy pojedynczo lub podwojnie wia

zanej.

Zaimplementuj metody:

– front() Returns reference to the first element in the list – back() Returns reference to the last element in the list

– push front(g) Adds a new element g at the beginning of the list – push back(g) Adds a new element g at the end of the list

– pop front() Removes the first element of the list, and reduces size of the list by 1 – pop back() Removes the last element of the list, and reduces size of the list by 1 – begin() Returns an iterator pointing to the first element of the list

– end() Returns an iterator pointing to the theoretical last element which follows the last element

– empty() Returns whether the list is empty(1) or not(0)

– insert() Inserts new elements in the list before the element at a specified position – erase() Removes a single element or a range of elements from the list

– assign() Assigns new elements to list by replacing current elements and resizes the list

– remove() Removes all the elements from the list, which are equal to given element – reverse() Reverses the list

– size() Returns the number of elements in the list – sort() Sorts the list in increasing order

Napisz kod do generacji testowego inputu oraz kod do generowania wzorcowego outputu w oparciu o implementacje class list w biblotece STL.

1

Cytaty

Powiązane dokumenty

[r]

Do generacji testowego inputu uzyj programu GenListUnion.cpp, dla wygenerowania wzorcowego outputu u˙zyj

[r]

Zadania programowe przygotowujemy w postaci kodu programu oraz dokumentu z kr´otkim opisem kodu oraz wynikami test´ow: plik.pdf (u˙zywamy latex, word) i umieszczamy w systemie Pegaz8.

Do generacji testowego inputu uzyj programu GenListUnion.cpp, dla wygenerowania wzorcowego outputu u˙zyj

Napisz kod do generacji testowego inputu dla tych metod oraz kod do generowania wzor- cowego outputu w oparciu o implementacje ‘ list w biblotece

Jaka by laby z lo˙zono´s´c obliczeniowa algorytmu

[r]