Dr. Robert Owor's Internet Collection of 100 Coding Challenges

Dr. Robert Owor's Internet Collection of 100 Coding Challenges

Dr. Robert Owor’s Internet Collection of 100 Coding Challenges Waiver This set of Coding Challenges was collected from Public Internet Sources. The intention is to teach Computer Science Students how to become great coders. I thank all the various authors of these problems who posted them on the Internet – Dr. Robert Steven Owor Instructions Here are 100 Coding problems. Write a running Computer program in one of the following 3 languages (Java, C++ or Python) to solve the problems listed below, and submit your solutions to me by email at [email protected] You have 21 Days beginning May 6th 2020. If you start after May 5th, that’s your problem. I expect the solution to all 100 Problems emailed to me by May 27th 2020, 11.55pm. If you would like to make another arrangement, please contact me at [email protected] Your Solutions for each number must consist of the following: (i) A Working Program which runs on https://www.tutorialspoint.com/codingground.htm (ii) Test Input Data (iii) Test Output Data which addresses, the zero input, wrong data type input, array boundaries, set values if any. I will grade your answers and give you a score out of 100 by May 30th 2020. If you score 80% or above, you will be invited to sit for an IBM Hackathon. There are possibilities for Internships and jobs if you score above 80% in both my 100-Problem Coding Challenge and the IBM Hackathon. Problems 1) Write code to check if a String is palindrome or not? 2) Write a method which will remove any given character from a String? 3) Print all permutation of a String both iterative and Recursive way? This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 1 4) Write a function to find out longest palindrome in a given string? 5) Write a Program which finds all unique substrings of length 2 or greater in a string 6) Write a Program which finds all vowels in a string. 7) In an array 1-100 numbers are stored, one number is missing how do you find it? 8) In an array 1-100 exactly one number is duplicate how do you find it? 9) In an array 1-100 multiple numbers there are duplicates, how do you find all duplicates? 10) Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array. 11) How do you find the second highest number in an integer array? 12) Find all unique pairs of numbers in an array of integers whose sum is the same? 13) Remove all duplicate elements from an Array? This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 2 14) How do you find middle element of a linked list in a single pass? 15) How do you find the 3rd element from last in a single pass? 16) How do you find if there is a cycle in a singly linked list? How do you find the start of the cycle? 17) Reverse a singly linked list? 18) Delete the pth element in a linked list using two implementations: Links and array data structure? 19) Find the largest and smallest number in an array? 20) Find the two maximum numbers in an array? 21) Find and print the depth of a binary tree? 22) Write code to print In-Order traversal of a binary tree? 23) Write code to print Post-Order traversal of a binary tree? 24) Write code to print Pre-Order traversal of a binary tree? 25) Print out all leaf node of a binary tree? 26) Write a program to check if a tree is a binary search tree or not This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 3 27) Write a Program to check if a tree is balanced or not. 28) Print all leaves of a binary search tree 29) Count the number of leaf nodes in a given binary tree 30) Perform a binary search in a given array 31) Write a program to sort numbers in place using quick sort 32) Write a program to implement a binary search/sort algorithm 33) Write code to implement Insertion Sort 34) Write code to implement Bubble Sort 35) Write Code to implement MergeSort 36) Write Code to implement HeapSort 37) Write Code to implement RadixSort 38) Write code to check whether a number is a power of two or not? 39) Write a program to check whether a number is a palindrome or not 40) Write code to check whether an integer is an Armstrong number or not? 41) Write a program to find all prime number up to a given number? This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 4 42) Write a function to compute Nth Fibonacci number? Both iterative and recursive? 43) Write a Program which checks if a number is binary? I.e. contains only 0s and 1s. 44) Write a Program to count the number of 1s in given binary integer? 45) Write a recursive program to find the sum of digits of a binary number? 46) Write a Program to swap two numbers without using temp 47) Write a Program to find the largest of three integers 48) Write a program to find prime factors of an integer 49) Write a Program to add two integers without using arithmetic operator 50) Implement a Stack of Integers using Arrays and then Linked Lists? This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 5 51) Convert an Arithmetic Expression into Postfix using a Stack 52) Evaluate a Postfix Arithmetic Expression using Stacks 53) Implement Bucket Sort 54) Implement the Subtraction of Two Binary Numbers 55) Print Floyd's triangle up to the 10th row 56) Print Pascal’s Triangle up to the 10th row 57) Calculate the Square root of a given number without using the Square Root function 58) Write a Program which converts a Decimal Number into Binary and a Binary Number into Decimal. 59) Write a Program to solve this problem: We are given strings containing brackets of 4 types - round (), square [], curly {} and angle <> ones. The goal is to check, whether brackets are in correct sequence. I.e. any opening bracket should have closing bracket of the same type somewhere further by the string, and bracket pairs should not overlap, though they could be nested: (a+[b*c] - {d/3}) - here square and curly brackets are nested in the round ones (a+[b*c) - 17] - here square brackets overlap with round ones which does not make sense 60) Here is the classical programming puzzle though it came from ancient times when there are no computers at all. We can see that practicing math and logic can sometimes save one's life! About 2000 years ago there was some war, and during one of its battles defendants were blocked by attackers in the cave. This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 6 To avoid capture they decided to stand in a circle and kill each third person until only one person remains - who was supposed to commit suicide - though he eventually preferred to surrender to enemies. The problem is called after this person - you may read the full story of Josephus and get math explanation of the problem in Wikipedia article. Your task is to determine for given number of people N and constant step K the position of a person who remains the last - i.e. the safe position. For example if there are 10 people and they eliminate each third: N = 10, K = 3 sequence of counting looks like this (brackets show persons who are eliminated): 1st round: 1 2 (3) 4 5 (6) 7 8 (9) 10 2nd round: 1 (2) 4 5 (7) 8 10 3rd round: (1) 4 5 (8) 10 4th round: 4 (5) 10 5th round: 4 (10) so the "winner" is one who was #4 at initial standing. Input data will contain number of people N and the counting step K. Answer should contain the number of person who will remain at the end. Initial numbering starts from 1. Example: initial data: This Set of Coding Problems was collected from Internet Public Sources for Teaching Purposes. - pg. 7 10 3 answer: 4 ------------------------------- 61) Write a Program to solve this problem: Two bicyclists start moving from different cities heading to meet each other somewhere in the middle (not exactly since they travel with different speed). The road is laid in straight line between two cities. You will be given the distance between cities S (in kilometers) and speed values for two bicyclists (A and B in kilometers per hour). Your task is to find their meeting point (its distance from the first of cities). Input data will have the number of test-cases in the first line. Next lines will contain three values each S A B. Answer should contain the distances between first city and rendezvous point (i.e. distance travelled by first cyclist before they meet), separated with spaces. Example: input data: 2 10 1 1 20 1 2 answer: 5 6.66666667 62. Cryptography is one of most interesting branches of programming. Studying its algorithms usually begins with the simple method named after famous Roman emperor Julius Caesar who used it for communicating his military secrets (and perhaps for love letters to Cleopatra).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    36 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us