0% found this document useful (0 votes)
25 views28 pages

FD 1

The document contains a series of questions and pseudo-code snippets related to programming concepts, algorithms, and data structures. It covers topics such as stack operations, sorting algorithms, hash functions, and Python syntax. The questions are designed to test knowledge on various programming principles and problem-solving skills.

Uploaded by

Keerthana Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
25 views28 pages

FD 1

The document contains a series of questions and pseudo-code snippets related to programming concepts, algorithms, and data structures. It covers topics such as stack operations, sorting algorithms, hash functions, and Python syntax. The questions are designed to test knowledge on various programming principles and problem-solving skills.

Uploaded by

Keerthana Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 28
ona s90rPw roete Questions What is the output of the following? a= (a2, 10) prine(hentTist(napCtrt, 39) Ifa stack of N elements is implemented with only one queue, one pop ‘operation is equal to how many enqueue and dequeue operations in general? What i the purpose ofthe apart nat ef to pene for 4 an eae tinea sare00 12: eecuen alee le snippet provided below? ‘3024, 097 Pt owen esti Consider the following pseudo-code that uses a stack. swste ( there are nore charactere inthe word to read ) ‘ i se Cane tad Se ot noty 9 aracler off the stack sweite Shel eharacter tothe tereen [What isthe output for input “doselectquiz” In the balanced binary tre inthe below figure, how many nodes will Become: unbalanced when 3 node is inserted a8 child of the node “g"? aN ‘3024, 097 Pt owen Which of the following statements is true? 1) Ahhach function takes an input (or ‘message) of any length and generates 2 fixed-length code. 2) A hash function takes a message ofa fixed length and generates a code of variable length 3) A hash function may produce the same hash value for distinct messages. From the following options, select the type of linked lst that is described by ‘the following . Each node has two links. points to the previous node, ora null value or an empty list in ‘cate itis the frst node, ‘3024, 097 Pt Powctan + One node points to the next, or a null value or empty listin case itis the last node, How many subarrays have to be searched to find the clement 0 ‘below array when the Binary search algorithm is a A= (01.23.4.5,12.13,15) Let us say you have the Fibonacci series in two lists: Fibt=11.1.23, Fib2=(13,21,34] How will you create alist in python that has all the above elements in o (Select all that apply) ‘3024, 097 Pt ewctane sion Problem Statement Take input from standard input into a variable 2g name then print “Hello, Input Format ‘The only line of the input will contain a string representing a name. Output Format Print string “Hell, " Evaluation Parameters Sample Input Sample Output ‘3024, 097 Pt owen Consider the array KI! = (6.4.8.1.3) apply the insertion sort to sort the array Consider the cost associated with each sorts 55 rupees , what isthe total cst ‘of the insertion sort when element 1 reaches the first postion of the array? What will stremp9 function returns when two strings are identical? owctane Select the correct output. omeesnge"docelect 4s the best platfora” Stypetnessere) esto 5 Select the appropriate code that performs Insertion sort. ewctane How many bits wil be in each group of IPV6? Which of the following statement is correct about the time complexity of BFS ‘and DFS traversal of graphs? ston 6 ‘Stephen has a linked list composed of 6 nodes that he wishes to sort. Given ‘the sorting techniques of Quick Sort and Merge Sort, which one would be the ‘most suitable for his needs? ‘3024, 097 Pt owen Consider the following statements about the Insertion Sort algorithm: 1. When the Ie takes an order of n time to sments are already sort complete. 2.ttis a stable sorting technique. 5. 1tis typically used when the number of elements is extremely large. Which of the above statements are true? Consider a sorting technique referred to as "x. The following characteristics are known about : 1.XC Is not a comparison-based sorting technique. 2, The running time complexity of ' is O(n). owen 3. The space-time complexity is proportional tothe range of the data, Based on these characteristics, which sorting technique could °X" possibly be? Given an array that contains the numbers 1 through @ in ascending order, identify the longest subsequence where the product ofits elements, when divided by 8, yields a remainder of exactly 1. Which of the following Python expressions is functionally identical to the comity) «ti #3 count tay) = 2 ‘3024, 097 Pt owen Bran made a full binary tre. Ifthe binary tree contains 12 numbers of internal nodes, how many leave nodes does the binary tree contal choose from the following options. ‘The enquee() method is used to add an element to a queue whereas the ‘deque() method is used to remove an element from the queue. ‘What i the output of the following pseudocode? ‘3024, 097 Pt owen veto 25 ‘Consider the following algorithm. sezin AF top = 2 then stack empty Teon = Maco) Identify the correct statement about the operation being performed by the above algorithm. are te 729) [What isthe value of ar after sorting it in descending order using Python's builtin srt method? ‘3024, 097 Pt owen vsti 25 ‘What isthe syntax for using the "with" statement in Python? eesti 26 [What does the following code snippet do? Me sa Print mane Ls (0) and Xan (1) yeas old -foreat(ramt, ge)) vestion27 ‘Given a dictionary of items and their prices, filter out all the items that are cheaper than $10 using dictionary comprehension: tens = Cappte': 255, 1.75, ‘avocado: 5.98) ‘chrny’: 3.25, "apricot reset = (Sten! price for item, price in itens-item() 26 price’ 30) resi) ‘3024, 097 Pt owen What will be the output of the above code? Whats the output of the following code snl 8) prsne(a is) [What i the difference between the try’ and ‘except’ clauses in a try-except block? vein 30 ‘3024, 097 Pt owen [What isthe output of the following code? wien open "etaenteess W") as F ‘ante hwite Wore") ten opencretze rinse esat)) ten opencetae tt owrisec) stan 31 the output ofthe folowing cade snippet? et ae snbers te D2 nat ty rine aed ramets nas) vestion 52 ‘What wil be the output ofthe following code? printinsige top") ‘3024, 097 Pt owen petnetise beck) What is the worstease time complexity ofthe linear search algorithm? vest 34 Consider a stack with the following inital state, ‘The TOP pointer is initially at the postion ofthe last filled element (2), which is an index 2 (assuming 0-based indexing). ‘The value of x equals 0. ‘The following operation is being performed: ‘3024, 097 Pt Powctane How many elements are present in the stack after the operation has been performed? fon 4 in angst) “ors names: veto) print) ‘What will be the output of the following Python code snippet? tents b ye ise: ‘3024, 097 Pt owen Whats the value of “result” after executing the code s ‘Which concept in Object-Oriented Programming (OOP) allows a class to inherit attributes and methods from another class? ‘What is the result ofthe following bitwise AND operation? no AND 1011 ‘3024, 097 Pt owen Consider the Code Shi seode_start python ‘nam renberae[ CA)" Developer" "tnternediate") ("abhy","Desgner","Advances"), (Haran "Tester" prine(ain Values fron Teon Members") opinne")] pr tnenae ober) ae: naprtnc: (emer 219) ote end From the given Python code snippet provided, your task isto make ‘modifications to achieve the following objectives: 1. Display the roles in sorted form, 2. Obtain and print the count of total team members. the necessary code in the question where the extra code will sit to accomplish these objectives. owen [A student management system is implemented using Python. One of the ‘functionalities isthe printing of al student details along with the stut name hhaving the value ‘Abc’. The student array consists of stu, stu2, stu3, and stud. ‘The following code is written to fulfil this requirement: sole Ea SC a] prinestudenectatts") ‘ar st in ture ne) Praneo [What will happen when the given code is executed? owen 4 open fie procuceile « open productie. txt frend he tite ‘ead proguctrAletontert = productFTe.read() Srint(etad_prosuctFiecontent productiie-elare() ‘The above code is tested for implementation in a project developed on a Unix system. Ifthe fle mentioned in the code above is not closed exclusively, the ‘which will lead to-2 bad user experience. [What isa key characteristic ofan interpreter in the context of interpreted Tanguages? stints [What does a parallelogram representin flowcharts? Which type of algorithm uses a priority queue? ‘3024, 097 Pt owen ution ts In pseudocode, what does the following code represent: Whats an argument in a function eal? Can a function have ne parameters and stil return a value? ‘3024, 097 Pt ewctane ution 8 What isthe scope ofa loca variable declared inside a block? een ts ‘When a variable is shadowed, what happens? How does the scope of» static local variable compare te other local variables? ‘3024, 097 Pt owen ‘What will happen if you try to access a(S]? int] atv = (2. 4, 6; System.out printn(at What will be the value of this expression in a language where True is 1 and False is 0? True + False + 3 ‘3024, 097 Pt owen ‘What is the result ofthis logical AND operation? 10== 108e5 What i the value of this expression? [What is the final value of x after the following expression is evaluated? xe Sixes 3" 2) eatin 57 ‘3024, 097 Pt owen ‘What will the following loop print? vate (38) ( etme: > uetin 8 Which paradigm relies on defining data structures and operations as 3 ‘combination of functions and immutable data? What will be the output of the following code snippet? pubtte cass main ¢ ponte evede vod masn(Strngl) are) ( ‘inset 2 = naw Dor) akesonal)t > ? owen class tna ¢ ota maesounat) ¢ ‘systen.octorintin( Aedes Sound) ? y cae bog extends nina ( Bverrice vote makesains() { syatenoepranein Bark"): ‘What will be the result if you do not provide a constructor in a cass?

You might also like