You get a bonus - 1 coin for daily activity. Now you have 1 coin

TESTS TO LABORATORY WORKS on algorithms and structures

Lecture



Other peoples correct answered (level of difficulty) 46% questions
Lab 1. Semistatic data structures (stacks).

  1. What are the features of the queue?

  • open on both sides;

  • open on one side for insertion and deletion;

  • any item is available.

  1. What is the stack stack?

  • open on both sides for insertion and deletion;

  • any item is available;

  • open on one side for insertion and removal.

  1. What discipline of service is called FIFO?

  • stack;

  • turn ;

  • Dec

  1. What operation reads the top of the stack without deleting?

  • pop;

  • push;

  • stackpop.

  1. What is the rule to fetch an item from the stack?

  • first item;

  • last item;

  • any item.



Laboratory work 2. List data structures (singly-connected queues).

  1. How to free memory from an item from the list?

  • p = getnode;

  • ptr (p) = nil;

  • freenode (p);

  • p = lst.

  1. How to create a new list item with information field D?

  • p = getnode;

  • p = getnode; info (p) = D;

  • p = getnode; ptr (D) = lst.

  1. How to create an empty element with a pointer p?

  • p = getnode;

  • info (p);

  • freenode (p);

  • ptr (p) = lst.

  1. How many pointers are used in single-linked lists?

  • one ;

  • 2;

  • any number

  1. What is the distinctive feature of dynamic objects?

  • generated immediately before the execution of the program;

  • arise in the course of the program;

  • set during program execution.


Laboratory work 3. List data structures.

  1. When removing an item from the ring list ...

  • the list is broken;

  • a hole appears in the list;

  • the list gets shorter by one item.

  1. What is the pointer used in ring lists?

  • to reference the next item;

  • to memorize the number of the element location segment;

  • to link to the previous item;

  • for the location of the item in the memory list.

  1. What is the difference between a ring list and a linear one?

  • in the ring list, the last element is simultaneously the first one;

  • in the ring list, the last element pointer is empty;

  • there is no last item in the ring lists;

  • in the ring list, the last element pointer is not empty.

  1. How many pointers are used in a single ring list?

  • one;

  • 2;

  • any number

  1. In which directions can you navigate in the bidirectional ring list?

  • in both ;

  • to the left;

  • to the right.


Lab 4. Model of queuing.

  1. What is the difference between the first priority application and the second priority application?

  • the fact that the application of the second priority is served with the probability P = 1, and the application of the first priority is served with the probability P (B);

  • the fact that the application of the second priority goes to the top of the queue, and the first priority goes to the end of the queue;

  • nothing if there is a queue.

  1. Can the first priority application displace the second priority application from the queue?

  • yes, if P (B) = 1;

  • Yes;

  • not .

  1. Can the first priority application be serviced if the second priority application is in the queue?

  • yes, if P (B) = 1;

  • Yes ;

  • not.

  1. What data structure is the most efficient way to implement a queue?

  • stack;

  • list;

  • Dec

  1. When the application leaves the system. Find the error.

  • if the application was served by the number of clocks enclosed by it;

  • if the application is in the queue for more than T cycles;

  • if the applications of the second priority became more than the applications of the first priority.


Laboratory work 5. Binary trees (basic procedures).

  1. To include a new vertex in the tree, you need to find a node to which it can be attached. The node will be found if the next link defining the branch of the tree in which to continue the search is the link:

  • p = right (p);

  • p = nil;

  • p = left (p).

  1. To write a procedure on two trees, you need to describe an element of the record type that contains the fields:

  • Element = Record

Left, Right: Pointers

Rec: Record;

  • Element = Record

Left: Pointer

Key: Key

Rec: Record;

  • Element = Record

Left, Right: Pointers

Keu: Key

Rec: Record.

  1. In computer memory, a binary tree can be conveniently represented as:

  • linked linear lists;

  • arrays;

  • linked non-linear lists.

  1. Element t for which there are no links:

  • root;

  • intermediate;

  • terminal (list).

  1. A tree is called complete binary if the degree of outcomes of the vertices is:

  • 2 or 0;

  • 2;

  • M or 0;

  • M.


Laboratory work 6. Sorting by direct inclusion.

  1. Three conditions are given for the end of sifting when sorting by direct inclusion. Find among them too much.

  • found the element a (i) with a key smaller than the key at x;

  • found the element a (i) with a key larger than the key of x;

  • Reached the left end of the finished sequence.

  1. Which of the criteria for sorting efficiency is determined by the formula M = 0.01 * n * n + 10 * n?

  • number of comparisons;

  • time spent writing a program;

  • number of movements;

  • time spent on sorting.

  1. What is the name of the sorting that happens in RAM?

  • sorting the address table;

  • complete sorting;

  • live-sorting;

  • internal sorting;

  • external sorting.

  1. How can I reduce the cost of machine time when sorting a large amount of data?

  • to sort in the table of addresses of keys;

  • produce sorting on a more powerful computer;

  • split the data into smaller portions and sort them.

  1. There are the following sorting methods. Find the error.

  • strict;

  • advanced;

  • dynamic.


Lab 7. Selection by direct selection.

  1. The sorting method is called sustainable if the sorting process ...

  • relative positioning of the elements is indifferent;

  • the relative arrangement of elements with equal keys does not change;

  • the relative position of elements with equal keys changes;

  • relative position of elements is not defined.

  1. Improved methods have a significant advantage:

  • with a large number of sorted elements;

  • when the array is back ordered;

  • with small quantities of sorted elements;

  • in all cases.

  1. Which of the following concepts is one of the types of sorting?

  • internal sorting;

  • descending sorting;

  • data sorting;

  • Sort Ascending.

  1. How many comparisons does an improved sorting algorithm require?

  • n * log (n);

  • e n ;

  • n * n / 4.

  1. Which method is the sort that requires n * n key comparisons?

  • direct;

  • binary;

  • the simplest;

  • the reverse.


Lab 8. Sorting using direct exchange.

  1. How many comparisons and permutations of elements are required in bubble sorting?

  • n * lon (n);

  • (n * n) / 4;

  • (n * nn) / 2.

  1. How many additional variables do you need in bubble sorting besides an array containing elements?

  • 0 (not needed);

  • only 1 item;

  • n variables (exactly as many elements in the array).

  1. How to sort an array faster using the bubble method?

  • equally;

  • on the recovery of elements;

  • descending elements.

  1. What is the idea behind the QuickSort method?

  • selection of 1,2, ... n - th element for comparison with the rest;

  • separation of keys in relation to the selected one;

  • exchange of places between adjacent elements.

  1. The array is sorted by the “bubble” method. For how many passes through the array the “easiest” element in the array will be at the top?

  • for 1 pass;

  • in n-1 passes;

  • for n passes, where n is the number of array elements.


Lab 9. Sort using the tree.

  1. When traversing a tree


TESTS TO LABORATORY WORKS on algorithms and structures

from left to right, we get a sequence ...

  • sorted in descending order;

  • unsorted;

  • sorted by ascending.

  1. Which of the three trees is not strictly balanced?

TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

  1. When traversing a tree from left to right, its element is entered into an array ...

  • during the second entry into the element;

  • when you first enter the item;

  • at the third entry into the element.

  1. The element of the array with the key k = 20 must be inserted into the depicted tree so that the tree remains sorted. Where to insert it?



TESTS TO LABORATORY WORKS on algorithms and structures

  • the left son of element 30;

  • the left son of element 41;

  • element 8's left son.

  1. By traversing which tree from left to right is an array sorted in ascending order?



TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.


Laboratory work 10. Investigation of methods of linear and binary search.

  1. Where is linear search effective?

  • in the list;

  • in array;

  • in the array and in the list.

  1. What search is more effective?

  • linear;

  • binary;

  • no difference.

  1. What is the essence of a binary search?

  • finding an element of array x by dividing the array in half each time until the element is found;

  • finding the element x by traversing the array;

  • finding the element of array x by dividing the array.

  1. How are the elements in the binary search array?

  • Ascending ;

  • chaotically;

  • descending.

  1. What is the essence of linear search?

  • sequential viewing is performed from beginning to end and back through 2 elements;

  • sequential view of the elements from the middle of the table;

  • sequential viewing of each item.


Laboratory work 11. Research of search methods with moving to the beginning and transposition.

  1. Where is the transposition method most effective?

  • in arrays and lists;

  • only in arrays;

  • only in lists.

  1. What is the essence of the permutation method?

  • found element is placed in the head of the list;

  • the found element is placed at the end of the list;

  • found element is reversed.

  1. What is the essence of the transposition method?

  • rearrangement of adjacent elements;

  • finding the same elements;

  • permutation of the found element by one position towards the beginning of the list.

  1. What is a unique key?

  • if the difference between the values ​​of the two data is equal to the key;

  • if the sum of the two data values ​​is equal to the key;

  • if there is only one data in the table with such a key.

  1. What is the purpose of the search?

  • among the data array to find the data that match the specified argument;

  • determine that there is no data in the array;

  • using data to find the argument.


Laboratory work 12. Search the tree with the inclusion.

  1. In which binary tree do you need to sort out N / 2 elements on average in binary search?


TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

  1. How many elements need to be sorted out in a balanced tree?

  1. N / 2;

  2. Ln (N);

  3. Log 2 (N);

  4. e N.

  • A;

  • B;

  • C;

  • D.

  1. Select the tree variant obtained after inserting the node -1.


TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

  1. Which element attach element 40 to insert it into this tree?


TESTS TO LABORATORY WORKS on algorithms and structures

  • by the 30th;

  • by the 15th;

  • by –15;

  • by the 5th.

  1. What kind of tree will take after the entry of the element with key 58?


TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.


Lab 13. Search the tree with the exception.

  1. Select the variant of the tree obtained after removing the node –3.



TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

  1. What version of the tree will be obtained after removing the element –1, and then –8?


TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

  1. Select the variant of the tree obtained after removing the node with index 0.


TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

  1. Which of the following pairs of numbers can become the roots of a tree after removing element 10 according to two ways to remove a node that has two sons?


TESTS TO LABORATORY WORKS on algorithms and structures

  • 0 or 15;

  • 0 or 20;

  • 5 or 30;

  • 5 or 15.

  1. What kind of tree will take after deleting an item with key 58?


TESTS TO LABORATORY WORKS on algorithms and structures

  • A;

  • B;

  • C.

Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Structures and data processing algorithms.

Terms: Structures and data processing algorithms.