Looking for Course 413 test answers and solutions? Browse our comprehensive collection of verified answers for Course 413 at else.fcim.utm.md.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
std::list < int > lst = {1}; lst.pop_front(); lst.pop_front(); std::cout << lst.empty();
PNode MakeTree (char Expr[], int first, int last)
{ int MinPrt, i, k, prt; PNode Tree = new Node; // создать в памяти новую вершину
if ( first == last ) { // конечная вершина: число или
Tree->data = Expr[first]; // переменная
Tree->left = NULL; Tree->right = NULL;
return Tree;
}
MinPrt = 100;
for ( i = first; i <= last; i ++ )
{ prt = Priority ( Expr[i] );
if ( prt <= MinPrt )
{ // ищем последнюю операцию
MinPrt = prt; // с наименьшим приоритетом
k = i;
} }
Tree->data = Expr[k]; // внутренняя вершина (операция)
Tree->left = MakeTree (Expr,first,k-1); // рекурсивно строим
Tree->right = MakeTree (Expr,k+1,last); // поддеревья
return Tree; }
std::deque < int > dq = {9, 2, 5}; dq.clear(); dq.push_back(11); dq.push_front(8); std::cout << dq.back() << " "; for (int x : dq) std::cout << x << " ";
Дан образец
P = abcdabcdabcd, Чему равно max δ(n, a)? n от 0 до length(P).
int main()
{
struct S { int x; int y; };
struct S A = {4,6};
struct S *p = &A;
printf("%d %d", (*p).x++, (*p).y++);
return 0;
}
struct S { int a; struct S *b; struct S *prev; };
struct S *x = malloc(sizeof(struct S));
struct S *y = malloc(sizeof(struct S));
struct S *z = malloc(sizeof(struct S));
x->a = 1; x->b = z; x->prev = y;
z->a = 2; z->b = y; z->prev = x;
y->a = x; y->prev = z;
printf("%d", x->b->b->b->b->b->a);
std::queue < int > q;
q.push(7);
if(!q.empty())
{
q.pop();
}
else
{
q.push(5);
}
std::cout << q.empty();
Дан массив [10, 4, 7, 1, 9, 2, 8, 5, 6, 3]. Использовать процедуру Heapify (построение снизу вверх). Ответ Max-Heap:
struct S {
int S;
int a;
} ;
struct S {
struct S s;
int a;
} S,s ;
int main()
{
printf("%d %d ",S.s.S++,--S.s.a);
return 0;
}