CS3310

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

JSON-LD

(JavaScript Object Notation for Linked Data) offers a simpler means to create machine-readable data from websites to promote search results. ... As a result, Google and Bing are embracing JSON-LD because structured data allows developers to easily organize and connect data. Google Search works hard to understand the content of a page. You can help us by providing explicit clues about the meaning of a page to Google by including structured data on the page. Structured data is a standardized format for providing information about a page and classifying the page content; for example, on a recipe page, what are the ingredients, the cooking time and temperature, the calories, and so on. Google uses structured data that it finds on the web to understand the content of the page, as well as to gather information about the web and the world in general. For example, here is a JSON-LD structured data snippet that might appear on a recipe page, describing the title of the recipe, the author of the recipe, and other details: https://developers.google.com/search/docs/guides/intro-structured-data#structured-data

is-a relationship means:

- All subclass inherits all attributes and methods of parent class - Subclass can override method of parent class - Subclass can have additional method that parent class doesn't have

Inner Class:

- Nested Inner class - Method Local inner classes - Anonymous inner classes - Static nested classes

.net

- free, open source, cross platform developer environment - common runtime with extensive class libraries - develop in multiple languages - build web apps, mobile apps, desktop, games, loT(internet of things), etc. - BASIC language targeting the .NET Framework - Fully integrated into Visual Studio - Supported and updated by Microsoft as each new version of VB.NET comes out

Why choose VB.NET

- it is object oriented, type-safe, quick and easy to build .NET applications

Dynamic type

- once compiler doesn't complain, you can run the program. Dynamic type decides which method is called. (performs checking during run time) - while dynamically-typed languages do not require you to declare the data types of your variables before you use them. -

Static type

- used by compiler - statically-typed languages require you to declare the data types of your variables before you use them,

Hardware vendor XYZ Corp. claims that their latest computer will run 10 times faster than that of their competitor, Prunes, Inc. If the Prunes, Inc. computer can execute a program on input of size n in one minute, what size input can XYZ's computer execute in one minute for an algorithm whose growth rate is 3n-9?

10n-27

How many keys can a btree store

124

Composite data type

A data type that allows a collection of values to be associated with an object of that type

disadvantages of a queue

A major disadvantage of a classical queue is that a new element can only be inserted when all of the elements are deleted from the queue.

Microsoft SQL Server

A server application that hosts databases accessible from web servers and a wide array of applications

The mid-squares method hash function makes use of:

All of the digits or bits of the key

Which of these is the best definition for a stable sorting algorithm? An algorithm that always gives the same order for duplicate keys from run to run An algorithm that is as fast as the best one known An algorithm that always gives the right answer An algorithm that does not change the relative ordering of records with identical keys

An algorithm that does not change the relative ordering of records with identical keys

Linux

An open source software operating system.

computer system

An organization of hardware and software designed to accomplish a data processing function.

Angular

Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript libraries that you import into your apps.

BTree

B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree is a generalization of a binary search tree in that a node can have more than two children.

FileOutputStream

Connects PrintWriter to a text file; - is used to create a file and write data into it. - The stream would create a file, if it doesn't already exist, before opening it for output. ex1: OutputStream f = new FileOutputStream("C:/java/hello") ex2: File f = new File("C:/java/hello"); OutputStream f = new FileOutputStream(f);

What are the two file names used?

Example: outputStream and out.txt

A company wants to use a system where they randomly assign each customer a 9-digit ID (so there are 1 billion possible ID numbers). Of course, there is a chance that two customers will be assigned the same ID. But the company figures that risk is OK if the odds are small enough. They expect to assign IDs to 1000 customers. The chance of a collision is therefore one in a million. True False

False

For the string hash functions, the size of the hash table limits the length of the string that can be hashed. True False

False

When solving a computational problem or designing a software applications, a problem instance deals with the range of values the problem input can take. T or F

False

The Queue is best characterized as:

First-In, First-Out

hashing

In hashing there is a hash function that maps keys to some values. But these hashing function may lead to collision that is two or more keys are mapped to same value. Chain hashing avoids collision. The idea is to make each cell of hash table point to a linked list of records that have same hash function value.

LINQ

Language Integrated Query

benefits of a linked list

Linked List is Dynamic data Structure . Linked List can grow and shrink during run time. Insertion and Deletion Operations are Easier. Efficient Memory Utilization ,i.e no need to pre-allocate memory. Faster Access time,can be expanded in constant time without memory overhead.

Consider a singly linked list of n nodes. It has a head pointer and a cur pointer. Cur points to a node that is under consideration. What is the time taken (most efficient) to insert a new node after the node pointed by cur?

O(1)

When implementing Insertion Sort, a binary search could be used to locate the position within the first i-1i−1 records of the array into which record ii should be inserted. In this implementation, the worst case time will be:

O(n^2)

Types of Java Classes:

POJO Class Static Class Concrete Class Abstract Class Final Class Inner Class: - Nested Inner class - Method Local inner classes - Anonymous inner classes - Static nested classes

POJO class (Java)

POJO stands for Plain Old Java Object. It is an ordinary Java object, not bound by any special restriction other than those forced by the Java Language Specification and not requiring any class path. POJOs are used for increasing the readability and re-usability of a program. As we know that in Java POJO refers to the Plain old Java object. POJO and Bean class in Java shares some common features which are as follows − Both classes must be public i.e accessible to all. Properties or variables defined in both classes must be private i.e. can't be accessed directly. Both classes must have default constructor i.e no argument constructor. Public Getter and Setter must be present in both the classes in order to access the variables/properties. The only difference between both the classes is Java make java beans objects serialized so that the state of a bean class could be preserved in case required.So due to this a Java Bean class must either implements Serializable or Externalizable interface. Due to this it is stated that all JavaBeans are POJOs but not all POJOs are JavaBeans. Example of Java Bean Class. public class Employee implements java.io.Serializable { private int id; private String name; public Employee(){} public void setId(int id){this.id=id;} public int getId(){return id;} public void setName(String name){this.name=name;} public String getName(){return name;} } Example of POJO Class. public class Employee { String name; public String id; private double salary; public Employee(String name, String id,double salary) { this.name = name; this.id = id; this.salary = salary; } public String getName() { return name; } public String getId() { return id; } public Double getSalary() { return salary; } }

what methods are used to open a text file for output?

PrintWriter and FileOutputStream Ex.) FileOutputStream s = new FileOutputStream("out.txt"); PrintWriter outputStream = new PrintWriter(s);

PHP (Hypertext Preprocessor)

Programming language used to build websites with interactive capabilities; adapts the HTML page to the user's selections.

Sorting Problem allows input with two or more records that have the same key value. T or F

TRUE

Which of these will NOT affect the RELATIVE running times for two sorting algorithms? The number of records The CPU speed The allowable range for the record values The amount by which the values are out of order

The CPU speed

HTML DOM

The Document Object Model is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree.

When is Insertion Sort a good choice for sorting an array?

The array contains only a few records

The binning hash function makes use of:

The high order digits or bits in the key

The simple mod hash function makes use of:

The low order digits or bits in the key

O(f(n))

The set of functions that grows no faster than f(n) ● asymptotic upper-bound on growth rate

Ω( f(n) )

The set of functions that grows no slower than f(n) ● asymptotic lower-bound on growth rate

Apache server software

The software used by a vast majority of web servers

The HTML <head> Element

This is how every HTML document is started off. The <title> tag might be something new to you. Since it's placed within our <head>, our users are not able to see this <title> on their screen. But their browser does display it on the page tab.

The html <nav> element

This is the HTML element that stores our navigation links. We then create a list within our <nav>using an unordered list aka a <ul>. Using <a href> tags, we place our links within an <li>.

Insertion Sort (as the code is written in this module) is a stable sorting algorithm. Recall that a stable sorting algorithm maintains the relative order of records with equal keys. T or F

True

Which is the best definition for collision in a hash table?

Two records with different keys have the same hash value

typescript

TypeScript is an open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. TypeScript is designed for development of large applications and transcompiles to JavaScript.

For the 'improved' string hash function that sums up 32-bit values each generated by 4 characters at a time, does the output change when the order of the letters changes?

Usually

In which case might the number of comparisons NOT be a good representation of the cost for a sorting algorithm? When we are comparing strings of widely varying length When the amount of available space is small When the CPU is really fast When there are lots of records

When we are comparing strings of widely varying length

Sometimes, the constant factors in an algorithm's runtime equation are more important thant its growth rate. When the problem is sorting, this can happen in which situation? -When the records are nearly sorted - When there are lots of records - When the records are nearly reverse sorted When the CPU is really fast When the amount of available space is small When we are sorting lots of small groups of records.

When we are sorting lots of small groups of records.

advantages of queue

While queues are more complex than stacks, the array makes queues easy by placing the newest element at the end and moving each element over one step when one piece of data is removed from the queue. Queues are helpful when multiple consumers share a particular process.

In which cases are the growth rates the same for Insertion Sort?

Worst and Average only

If you double the size of a hash table, can you keep using the same hash function?

Yes, but you will not hash to the new slots

Static class(Java)

You cannot use the static keyword with a class unless it is an inner class. A static inner class is a nested class which is a static member of the outer class. It can be accessed without instantiating the outer class, using other static members. Just like static members, a static nested class does not have access to the instance variables and methods of the outer class. Syntax class MyOuter { static class Nested_Demo { } } Instantiating a static nested class is a bit different from instantiating an inner class. The following program shows how to use a static nested class. public class Outer { static class Nested_Demo { public void my_method() { System.out.println("This is my nested class"); } } public static void main(String args[]) { Outer.Nested_Demo nested = new Outer.Nested_Demo(); nested.my_method(); } }

A data item is: a.) A member of a type b.) An object instantiated from a class c.) A specification of a type within some language d.) An implementation of an ADT

a

A range query is: a.) Where a record is returned if its relevant key value falls between a pair of values b.) Where a record is returned if its unique identifier matches the search value c.) A way of efficiently locating the records in a database d.) Another name for any database query for a key value

a

An exact-match query is: a.) Where a record is returned if its unique identifier matches the search value b.) A way of efficiently locating the records in a database c.) Where a record is returned if its relevant key value falls within a specified range d.) Another name for any database query that returns a key value

a

In computer science a metaphor is: a.) A label applied to a group of concepts b.) A comparison that does not use the word 'like' c.) The model of a type d.) A figure of speech in which a phrase is applied to an object to which it is not literally applicable

a

hard drive

a collection of hardware that manipulates data on a particular type of storage device

network

a group of two or more computer systems linked together

VPN (Virtual Private Network)

a network that uses a public telecommunication infrastructure, such as the Internet, to provide remote offices or individual users with secure access to their organization's network

Assume that an array consists of at least 10 elements. The worst case time (in the big-oh sense) occurs in linear search algorithm when a. Item is not in the array at all b. Item is somewhere in the middle of the array c. Item is the first element in the array d. Item is the 1000th element of the array e. Item is the 10th element in the array f. Item is the last element in the array

a. Item is not in the array at all b. Item is somewhere in the middle of the array f. Item is the last element in the array

An ADT is most like which of the following? a.) A class b.) An interface c.) A program d.) An object e.) A method f.) A data structure

b

Which is NOT a topic that OpenDSA focuses on? a.) How to measure the effectiveness of a data structure or algorithm b.) How to design and maintain large programs c.) The commonly used data structures d.) Introduce the idea of tradeoffs and reinforce the concept that there are costs and benefits associated with every data structure

b

Which is an example of a composite type? a.) An integer b.) A bank account record c.) A character d.) A floating point number

b

Which of these is NOT a definition for efficiency in a computer program? a.) It solves the problem within the required resource contraints b.) It runs in linear time c.) It requires fewer resources than known alternatives

b

Which of these is NOT one of the three standard steps to follow when selecting a data structure to solve a problem? a.) Select the data structure that best meets the requirements determined in the prior steps of the process b.) Run simulations to quantify the expected running time of the program c.) Quantify the resource constraints for each operation d.) Analyze your problem to determine the basic operations that must be supported

b

Which of these is more a concern for Software Engineering than for a data structures course? a.) To design an algorithm that makes efficient use of the computer's resources b.) To design an algorithm that is easy to understand, code, and debug

b

A type is: a.) A variable b.) Another name for an ADT c.) A collection of values d.) An integer e.) An implementation

c

(Recall that MM refers to the size of a hash table.) A hash function must: a.) Return a value betwen 1 and MM b.) Return values in equal distribution throughout the table c.) Return a value between 0 and M-1M−1 d.) Return the hash value for the key

c.) Return a value between 0 and M-1M−1

A simple type is: a.) A subset of a type b.) The simplest type in a class c.) The model of a type d.) A type that cannot be broken down into smaller types

d

A tool for measuring the efficiency of an algorithm or problem is: a.) The system clock b.) Empirical analysis c.) A profiler d.) Algorithm analysis

d

A data structure is: a.) Another name for an ADT b.) A specification for an implementation c.) A type d.) A collection of values e.) The implementation for an ADT

e

An ADT is a form of: a.) Simile b.) Metaphor c.) Design d.) Programming e.) Abstraction

e

Big O

f(n) ∈ O(g(n)) if there exists c, n0 > 0 such that f(n) ≤ c*g(n) for all n ≥ n0

Big Omega

f(n) ∈ Ω(g(n)) if there exists c, n0 > 0 such that f(n) ≥ c*g(n) for all n ≥ n0

In the worst case, the total number of comparisons for Insertion Sort is closest to:

n^2/2

For the simple string hash function that sums the ASCII values for the letters, does the order of the letters in the string affect the result?

no

buffer pool

serves as the database server's shared cache memory area (once a sector is read, its information is stored in main memory. This is known as buffering or caching the information)

CPU

the hardware that controls execution of computer instructions

A sorting algorithm is said to be stable if it does not change......

the relative ordering of records with identical key values

PrintWriter

to open a file for writing

What is the running time of Insertion Sort when the input is an array that has already been sorted?

Θ(n)

Given an array-based list implementation, inserting a new element takes how long in the average case?

Θ(n) time


Kaugnay na mga set ng pag-aaral

Accounting Chapter 14 - Statement of Cash Flows

View Set

Renal system NCLEX Type Questions

View Set

Macular Degeneration NCLEX questions

View Set

AP European History Semester 2 Final

View Set

TTT Exam 1 Chapter 2: Collecting Subjective Data: The Interview and Health History - ML8

View Set

The powers of state and local government

View Set