Homework1 (1).pdf - Data Structures and Algorithms INFO 6205 Homework1 Due Put all your java compiled class files and documentation files into a zip

Homework1 (1).pdf - Data Structures and Algorithms INFO...

This preview shows page 1 - 2 out of 2 pages.

Data Structures and Algorithms INFO 6205 Homework1 Due: September 14, 2019 Put all your java, compiled class files and documentation files into a zip file Homework1.zip and submit it via the drop box on the blackboard before the END of due date. Put your name on all .java files. There will be a short quiz on this homework. 1. Read references on Java, Stacks, Algorithm Analysis and Slides provided 2. What is an Algorithm? Give five examples 3. What is time and space complexity of an algorithm? 4. What is the time complexity of the following code, and why? public makeSentence ( String[] words) { String sentence=“”; for (String w:words) { sentence+=w; } return sentence; } 5 . What are all Stack operations, explain. 6 . Consider String “It was the best of time”. Start with the first word, design a Stack such that when you read back the words, the order of string does not change. Write Java code for all necessary operations of Stack. Compile and run the code.
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Summer '17
  • Big O notation, Analysis of algorithms, Computational complexity theory

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture