title-img


Compare two linked lists

You’re given the pointer to the head nodes of two linked lists. Compare the data in the nodes of the linked lists to check if they are equal. If all data attributes are equal and the lists are the same length, return 1. Otherwise, return 0. Example: list1=1->2->3->Null list2=1->2->3->4->Null The two lists have equal data attributes for the first 3 nodes. list2 is longer, though, so the lists are not equal. Return 0. Function Description: Complete the compare_lists function in the

View Solution →

Java Strings Introduction

This exercise is to test your understanding of Java Strings. A sample String declaration: String myString = "Hello World!" The elements of a String are called characters. The number of characters in a String is called the length, and it can be retrieved with the String.length() method. Given two strings of lowercase English letters, A and B, perform the following operations: 1.Sum the lengths of A and B. 2.Determine if is lexicographically A larger than B(i.e.: does B come before A

View Solution →

Java Substring

Given a string, s, and two indices, start and end, print a substring consisting of all characters in the inclusive range from start to end-1. You'll find the String class' substring method helpful in completing this challenge. Input Format The first line contains a single string denoting s. The second line contains two space-separated integers denoting the respective values of start and end. Constraints 1<=|s|<=100 0<=start<end<=n String s consists of English alphabetic letters

View Solution →

Java Substring Comparisons

We define the following terms: Lexicographical Order, also known as alphabetic or dictionary order, orders characters as follows: A<B<...<Y<Z<a<b<...<y<z For example, ball < cat, dog < dorm, Happy < happy, Zoo < ball. A substring of a string is a contiguous block of characters in the string. For example, the substrings of abc are a, b, c, ab, bc, and abc. Given a string, s, and an integer, k, complete the function so that it finds the lexicographically smallest and largest sub

View Solution →

Java String Reverse

A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward.(Wikipedia) Given a string A, print Yes if it is a palindrome, print No otherwise. Constraints A will consist at most 50 lower case english letters.

View Solution →