Sql relational division example

Problem Given the following database tables Employee (SSN, name, location) Assigned (SSN, project_name, duration) Project (project_name, category, budget, location) Write SQL statements to find the following: Project names with a budget smaller than the average budget of projects in a …

Read more »

Character count in string Java

Problem Write a Java program to find character counts in a string consisting from capital letters (A to Z) only. The program must not use nested loops. Hash tables that are built in to the language must not be used …

Read more »

3 Ants Triangle Puzzle

Triangle ants problem Three ants on the corners of an equilateral triangle. They started moving along the edges at the same speed. What is the probability that the ants will collide ? Solution Each ant could possibly be moving in …

Read more »

Word count perl script

Find word count using perl Write a perl program that prints word count in file. For example if the input file contains the following word occurrences “Santa Clara is located in Santa Clara county” the program should print something like: …

Read more »

Perl compare two arrays

Two arrays differences Given two integer arrays A and B of the same size each having no duplicate values. Write an equality function that returns true if A and B are equivalent. The arrays are equivalent if they contain the …

Read more »

Java stack class example

Problem Write a Java class to implement a stack data structure using an array for storage. The stack must support pop and push operations. Java stack implementation A stack is a LIFO (last in first out) data structure. A push …

Read more »

Recursive sum function

Array recursive sum problem Given an array of N integers. Write a recursive function to calculate the sum of all elements in the array. Recursive sum algorithm The sum of N elements in a list is equivalent to the sum …

Read more »

Page 29 of 30« First...1020...2627282930