Question: data structure pythone (1) The stack content after the following series of stack operations: S.push(1);S.push(2);S.pop( ) ;S.push(3);S.top( );S.push(4); A. [1,4] B. [1,2,3,4] C. [1,3,4] D.

data structure pythone
data structure pythone (1) The stack content after the following series of
stack operations: S.push(1);S.push(2);S.pop( ) ;S.push(3);S.top( );S.push(4); A. [1,4] B. [1,2,3,4] C. [1,3,4]

(1) The stack content after the following series of stack operations: S.push(1);S.push(2);S.pop( ) ;S.push(3);S.top( );S.push(4); A. [1,4] B. [1,2,3,4] C. [1,3,4] D. [1,2,4] (2) After the operations of the question (1), the output of S. top() is: A. [1,2,3] B. 4 C. [4] D. 1 (3) After the operations of the question (1), the output of len(S) is: A. 1 B. 2 C. 3 D. 4 (4) The In the array-based stack, the fit method to be used yielding the top () method function is: [2 pt] A. list [-1] B. list [0] C. list.append() D. list.pop() (5) The value of the var 2 variable after the execution is: [2 pt] 1246X=ArrayStack0str1="Hello";foriinstr1:foriinstr1:var2="X,push(i)var2+=X.pop() \begin{tabular}{llll} A. [H,e,eI,I,o] & B. [H,e,I,I,o] & C. Hello & D. olleH \\ \hline Solve the questions (6,7,8,8) based on the following Python script: \end{tabular} (6) The output of the print statement line 4 is: [2 pt] A. No B. Yes C. True D. False (7) The value of the sequence var2 [0:2] after execution the script is: [2 pt] A. "iH" B. "dy" C. "Hi" D. " yd " (8) After execution the first 3 lines the value of len (Y) is: [2 pt] A. 11 B. 12 C. 5 D. 2 (9) Assume a Deque instance is not empty nor full. The following function can be used in a Deque class with the target and name of: [2 pt] (10) Related to the Singly Linked List, the number of the incorrect line in terms of its order in the following algorith m is: [2 pt] 12345defaddfirst(Lst,element):newest=Node(element)Lst.head=newestnewest.next=Lst.headLst.size=Lst.size+1 A.5 B. 4 C. 3 D. 2 (11) In singly linked stack, there is no tail pointer because: [2 pt] A. You cannot have a tail pointer in singly linked list's structure. B. Tail pointer points to the same location as the head pointer. C. All operations are done at the head. D. Tail may lead to fatal errors. (12) An empty doubly linked list has: [2 pt] A. Two special nodes B. No nodes at all C. Only a trailer node D. Only a header node (13) A node in a doubly linked list has the following: [2 pt] A. Four references, 2 for next node and 2 previous node. B. Three references, to the previous \& next nodes and to the element. C. Two references, to the header and to the trailer. D. One reference only to the element

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!