What is a hash table? *
A structure that maps keys to values
A structure that maps values to keys
A structure used for storage
A structure used to implement stack and queue
Make a surprise list with the elements "Groucho," "Chico," and "Harpo."
Create a program that will accept positive or negative number and store it to a list. Accepting input will stop when empty input is encountered. Count and display all positive and negative number input and its index number in the list. Count and display all even and odd positive numbers and its index number. Exclude 0 input.
Example:
number 1: 78
number 2: 91
number 3: -5
number 4: 0
number 4: 8
number 5: -100
number 6: -2
number 7: 100
number 8:
There are 4 positive numbers
All positive numbers: 78 91 8 100
Positive numbers can be found at index number: 0 1 3 6
There are 3 negative numbers
All negative numbers: -5 -100 -2
Negative numbers can be found at index number: 2 4 5
There are 3 positive even numbers
Positive even numbers are: 78 8 100
Positive even numbers can be found at index: 0 3 6
There are 1 positive odd numbers
Positive odd numbers are: 91
Positive odd numbers can be found at index: 1
Create a program that will accept a string. Count the length of the string and convert all vowels to upper case and all consonants to lower case. Count number of vowels and consonants in the string. Display all vowels and consonant characters found in the string and the index number of each vowel and consonant character.
Example:
Enter a string: the quick brown fox
String length is 19
Converted string in upper case and lower case: thE qUIck brOwn fOx
There are 5 vowels
Vowel characters are: e u i o o
Vowel characters can be found at index: 2 5 6 12 17
There are 11 consonants characters.
Consonant characters are: t h q c k b r w n f x
Consonant characters can be found at index: 0 1 4 7 8 10 11 13 14 16 18
given two strings write a program to determine if a string s2 is a rotation of another string s1 in python in easy method
given a integer valun N as input, write a program to print a shaded diamond of 2*N-1 rows using astherisk(*) character..
write a program to implement reversal of a string using stack data structure
Let A be an array of size n. Choose the first value as pivot. Write a program to partition the array based on the pivot value so that all values to
the left of pivot are lesser and right of pivot are greater than the pivot.For example, if A = [60, 67, 34, 23, 32, 54, 76] is the input, the output has to be A =[23, 54, 34, 32, 60, 67, 76]. Since 60 is the pivot, left of 60 are lesser than 60 and the right values are greater than 60
write a program in Python to store the name of five cities list create a function search name to search city using Linear search if the required name was and name it is not available the function should return -1
Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, then denominator. Make sure to check if the denominator is zero.