Laboratory Work №2 Theme: Implementation of functions, parameters and data transfer Aim



Download 263,25 Kb.
bet4/4
Sana01.01.2022
Hajmi263,25 Kb.
#293403
1   2   3   4
Bog'liq
DSA Lab2

Task 3: Define a new semi-static data structure (stack). Describe the standard operations for working with a semi-static data structure (adding a new element, extracting an element, printing the structure, deleting an element, determining the length, filling the structure).

1. Insert element '0' in the middle of the stack if the number of elements is even, and after the middle element if it is odd.

2. Find the maximal element of the stack and insert 0 after it.

Find the minimum element of the stack and insert 0 after it.

4. Write the procedure of replacement of the first and the last element of the stack

5. Write a procedure of permutation of the maximal and minimal elements of the stack

6. Write a procedure for unfolding the stack, i.e. make the "bottom" of the stack the top and the top the "bottom".

7. Write a procedure to remove all elements from the stack equal to the first.

8. Write a procedure to remove all elements from the stack, equal to the last one.

9. To write a procedure of removing of the maximal element of a stack

10. Write a procedure to delete the minimum element of the stack

11. Write a procedure to delete odd stack elements.

12. Write a procedure to delete even elements of the stack.

13. Write a procedure to delete an element that is in the middle of the stack if the number of elements is odd, and if it is even, the two middle elements.

14. Write a procedure to remove elements that are root

15. Write a procedure to delete elements that are prime numbers

REVIEW QUESTIONS:

1. What is meant by the term "semi-static" and what characteristics it describes.

2. What is a stack. Describe the operations.

3. What is a queue. Describe the operations.

4. What is a dec. Describe the operations.

5. The logical representation of semi-static data structures.




Download 263,25 Kb.

Do'stlaringiz bilan baham:
1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish