Looking for DK24TT80162_Cấu trúc dữ liệu và giải thuật (28/02 - 25/04/2025) test answers and solutions? Browse our comprehensive collection of verified answers for DK24TT80162_Cấu trúc dữ liệu và giải thuật (28/02 - 25/04/2025) at lms.rdi.edu.vn.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
19
|
3
|
13
|
10
|
2
|
18
|
5
|
7
|
void ProList(List &l, Node* p)
{
if (l.pHead==NULL)
{
l.pHead = p;
l.pTail = l.pHead;
}
else
{
l.pTail->pNext = p;
l.pTail = p;
}
}
Hàm ProList cài đặt thao tác nào trong danh sách liên kết đơn?typedef struct Node
{
int Info;
Node* pNext;
}Node;
typedef struct List
{
Node* pHead;
Node* pTail;
}List;
int ProList(List &l)
{
Node *p;
int a=0;
p = l.pHead;
while(p!=NULL)
{
a++;
p = p->pNext;
}
return a;
}Hỏi hàm ProList thực hiện công việc gì trong danh sách liên kết đơn?
void Output(TREE Root)
{
if (Root != NULL)
{
printf(“%d ”,Root-> Key);
if (Root->pLeft!=NULL)
Output(Root->pLeft);
if (Root->pRight!=NULL)
Output(Root->pRight);
}
void ProSum(int &a, int &b)
{
a=b;
b=a;
}
void main()
{
int x=4;
int y=6;
ProSum(x, y);
printf(“%d %d”,x ,y);
}
Kết quả in ra màn hình khi thực hiện chương trình trên?Cho dãy số:
3
|
10
|
13
|
18
|
2
|
19
|
5
|
7
|
Áp dụng giải thuật sắp xếp nổi bọt (Bubble Sort)
theo thứ tự giảm dần trên dãy số trên, sau vòng lặp đầu tiên được
dãy số: