Please select a subject first
Advertisements
Advertisements
Write the file mode that will be used for opening the following file. Also, write the Python statement to open the following file:
a binary file “bfile.dat” in write mode.
Concept: undefined >> undefined
Write the file mode that will be used for opening the following file. Also, write the Python statement to open the following file:
a text file “try.txt” in append and read mode.
Concept: undefined >> undefined
Advertisements
Write the file mode that will be used for opening the following file. Also, write the Python statement to open the following file:
a binary file “btry.dat” in read only mode.
Concept: undefined >> undefined
Write a program to enter the following records in a binary file:
| Item No | integer |
| Item_Name | string |
| Qty | integer |
| Price | float |
Number of records to be entered should be accepted from the user. Read the file to display the records in the following format:
Item No:
Item Name :
Quantity:
Price per item:
Amount: (to be calculated as Price * Qty)
Concept: undefined >> undefined
Consider a list of 10 elements:
numList = [7, 11, 3, 10, 17, 23, 1, 4, 21, 5].
Display the partially sorted list after three complete passes of Bubble sort.
Concept: undefined >> undefined
Identify the number of swaps required for sorting the following list using selection sort and bubble sort and identify which is the better sorting technique with respect to the number of comparisons.
List 1:
| 63 | 42 | 21 | 9 |
Concept: undefined >> undefined
Write a program using user defined functions that accepts a List of numbers as an argument and finds its median. (Hint : Use bubble sort to sort the accepted list. If there are odd number of terms, the median is the center term. If there are even number of terms, add the two middle terms and divide by 2 get median)
Concept: undefined >> undefined
Using linear search determine the position of 8, 1, 99 and 44 in the list:
[1, -2, 32, 8, 17, 19, 42, 13, 0, 44]
Draw a detailed table showing the values of the variables and the decisions taken in each pass of linear search.
Concept: undefined >> undefined
Use the linear search program to search the key with value 8 in the list having duplicate values such as [42, -2, 32, 8, 17, 19, 42, 13, 8, 44]. What is the position returned? What does this mean?
Concept: undefined >> undefined
Write a program that takes as input a list having a mix of 10 negative and positive numbers and a key value. Apply linear search to find whether the key is present in the list or not. If the key is present it should display the position of the key in the list otherwise it should print an appropriate message. Run the program for at least 3 different keys and note the result.
Concept: undefined >> undefined
Following is a list of unsorted/unordered numbers:
[50, 31, 21, 28, 72, 41, 73, 93, 68, 43, 45, 78, 5, 17, 97, 71, 69, 61, 88, 75, 99, 44, 55, 9]
- Use linear search to determine the position of 1, 5, 55, and 99 in the list. Also, note the number of key comparisons required to find each of these numbers in the list.
- Use a Python function to sort/arrange the list in ascending order.
- Again, use linear search to determine the position of 1, 5, 55, and 99 in the list and note the number of key comparisons required to find these numbers in the list.
- Use binary search to determine the position of 1, 5, 55, and 99 in the sorted list. Record the number of iterations required in each case.
Concept: undefined >> undefined
Write a program that takes as input the following unsorted list of English words:
[Perfect, Stupendous, Wondrous, Gorgeous, Awesome, Mirthful, Fabulous, Splendid, Incredible, Outstanding, Propitious, Remarkable, Stellar, Unbelievable, Super, Amazing].
- Use linear search to find the position of Amazing, Perfect, Great, and Wondrous in the list. Also, note the number of key comparisons required to find these words in the list.
- Use a Python function to sort the list.
- Again, use linear search to determine the position of Amazing, Perfect, Great, and Wondrous in the list and note the number of key comparisons required to find these words in the list.
- Use binary search to determine the position of Amazing, Perfect, Great, and Wondrous in the sorted list. Record the number of iterations required in each case.
Concept: undefined >> undefined
A bank ‘xyz’ wants to know about its popularity among the residents of a city ‘ABC’ on the basis of the number of bank accounts each family has and the average monthly account balance of each person. Briefly describe the steps to be taken for collecting data and what results can be checked through the processing of the collected data.
Concept: undefined >> undefined
Identify the type of data being collected/generated in the following scenario:
Recording a video.
Concept: undefined >> undefined
Identify the type of data being collected/generated in the following scenario:
Marking attendance by the teacher.
Concept: undefined >> undefined
Identify the type of data being collected/generated in the following scenario:
Writing tweets
Concept: undefined >> undefined
Identify the type of data being collected/generated in the following scenario:
Filling out an application form online.
Concept: undefined >> undefined
For the annual day celebrations, the teacher is looking for an anchor in a class of 42 students. The teacher would make a selection of an anchor on the basis of singing skills, writing skills, as well as monitoring skills.
Which mode of data collection should be used?
Concept: undefined >> undefined
Using the sports database containing two relations (TEAM, MATCH_DETAILS) and write the Query for the following:
Change the name of the relation TEAM to T_DATA. Also, change the attributes TeamID and TeamName to T_ID and T_NAME respectively.
Concept: undefined >> undefined
Expand the following:
ARPANET
Concept: undefined >> undefined
