algorithms midterm

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/67

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:22 PM on 10/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

68 Terms

1
New cards

waterfall model

identify, design, implement, test, maintain

2
New cards

identify step

understand requirements, abstract idea of end result, follow software specifications

3
New cards

design step

considers low level requirements, determines data types and operations

4
New cards

implementation step

realization of an application, execution of a plan, idea, design, specification, selects language for coding procedure

5
New cards

testing/executing/debugging step

testing in real environments, finding and reducing bugs or errors in program

6
New cards

maintenance step

adding any modifications to handle new sw or hw components, cope with new problems or requirementst

7
New cards

three different abstractions

procedural abstraction, data abstraction, abstract data type

8
New cards

procedural abstraction

using subroutines, subfunctions, or submethods, writing subprograms as black boxes, hides details of process under a method name with parameters, breaks code into pieces, reusable

9
New cards

data abstraction

collections of data containing data + operations as abstract entities, uses class keyword to hide the detailed implementation, represents needed information without presenting details, abstract and extends keywords

10
New cards

abstract data type

separated object from an implementation, uses new keyword to create an object, considers one object whose behavior is defined by a set of data and operations

11
New cards

object oriented analysis

a method of analysis that examines requirements from the perspective of the classes and objects found in the problem domain, identifies and defines problem, requirements, and conceptual model of a software system, base model

12
New cards

object oriented design

process of planning a system of interacting objects for the purpose of solving a software problem, defines objects and interactions, can use UML to help model system

13
New cards

object oriented programming

software implementation technique to support analysis and design, supports inheritance and polymorphism, uses practice of abstraction and encapsulation

14
New cards

use case diagram

describes functional requirements of a system by showing the interactions between users (actors) and systems functionalities (use cases)

15
New cards

class diagram

represents classes, attributes, and methods, and the relationships between them, visually depicts encapsulation, inheritance hierarchies, and the static structure of a system

16
New cards

sequence diagram

illustrates dynamic interactions between objects over time, shows the ordering of messages exchanged between them, helps visualize how objects collaborate to achieve a specific functionality, demonstrates the flow of control and communication

17
New cards

encapsulation

grouping operations and attributes together into a single object, using classes

18
New cards

information hiding

hiding the details and implementation of data and methods for changing an objects state by presenting only an object’s behavior, using access identifiers

19
New cards

inheritance

a relationship among classes where one class shares the structure and/or behavior defined in one or more other classes, using derived classes (single, multiple, multilevel)

20
New cards

polymorphism

allows for a single interface to be used for different types of entities, allows an object to be treated as instances of their base class, overloading, overriding

21
New cards

constructor

used to initialize objects, ex: public class test {…}, every class inherently has a constructor

22
New cards

default/no argument constructor

constructor that takes no parameters

ex: class SRU {

int num;

string name;

}

SRU () {….}

23
New cards

paramterized constructor

a constructor that has parameters

ex: class SRU {

int num;

string name;

}

SRU (String name, int id) {..}

24
New cards

copy constructor

creates a new object by copying the field values of an existing object of the same class that is passed as an argument

ex: class Person {

Person (Person another_object) {

..}

…}

25
New cards

shallow copy

does not create a real object, set of the same memory location

<p>does not create a real object, set of the same memory location</p>
26
New cards

deep copy

the ability to copy a composed objects values to another new object, creates new memory space

<p>the ability to copy a composed objects values to another new object, creates new memory space</p>
27
New cards

static polymorphism

compile time, fast speed since already linked, less flexible since requires a certain load time, uses method overloading

28
New cards

method overloading

allows more than one method to have the same name but they have different parameters or different data types

<p>allows more than one method to have the same name but they have different parameters or different data types</p>
29
New cards

dynamic polymorphism

anything that is created can be changed during runtime, flexible since links are dynamic, slower because of additional linking process, method overriding

30
New cards

method overriding

runtime polymorphism, a child class can access and inherit the implementation of methods provided by the parent class, for objects of same type method is invoked via parent reference

<p>runtime polymorphism, a child class can access and inherit the implementation of methods provided by the parent class, for objects of same type method is invoked via parent reference</p>
31
New cards

primitive data type

pre-defined types of data, int, float, character, boolean

32
New cards

non-primitive data type

not defined by the programming language but instead are created by the programmer/user, class, string, object, array

33
New cards

overflow

an error that occurs when there are not enough bits to express the value,

34
New cards

underflow

values too close to zero to be represented

35
New cards

negative overflow

very small integers, < -232

36
New cards

positive overflow

very large integers, > 232

37
New cards

negative underflow

a value is too small negative number to be stored, -2^-127 <= very small negative number < 0

38
New cards

positive underflow

a value is too small positive number to be stored, 0 < (very small positive number close to 0) <= 2^-127

39
New cards

round off error

most real numbers do not have final exact binary representations, may be compounded in a sequence of operations, (0.7)100000

40
New cards

class

user defined data type that is used to create objects, contains a set of properties and methods that are common and exhibited by all the objects of the class, body and members, class name, access modifiers, superclass

41
New cards

interface

a tool to achieve abstraction, and it can define abstract class without a method body, specifies a set of methods that the class has to implement, blueprint of a class

42
New cards

string

non-primitive, holds a sequence of characters in a single variable, a class and type that encapsulates a set of characters and provides additional feature

43
New cards

arrays

non-primitive, used to store elements of the same data type in a contiguous manner, users declare and intialize, stored in an indexed manner

44
New cards

pointer

a variable whose value is a memory address, used as an indirect reference

45
New cards

address operator

&, returns memory address of operand

46
New cards

*

indicates a variable is a pointer, dereferencing/indirection

47
New cards

typedef

reserved keyword to create an alias name for a specific data type

48
New cards

typedef syntax

typedef <existing_name> <alias_name>;

49
New cards

enum

A special data type that represents a group of constraints

50
New cards

enum example

enum Color = { RED, ORANGE, YELLOW,

GREEN, BLUE, INDIGO, VIOLET };

51
New cards

generic method

uses angle brackets to represent type parameters, specifically defined as a method that declares its own parameters, cannot replace a primitive data type

52
New cards

generic method syntax

public static <T> void methodName (T element)

{ ....... }

53
New cards

generic method with array

public static <E> void print (E[] list)

{ .....}

54
New cards

generic class

includes a type parameter in class declaration by < > syntax to specify the parameter type, looks like a normal class declaration, except that the class name is followed by a type parameter section < >

55
New cards

generic class syntax

ClassName <Type> obj = new ClassName <Type> ();

56
New cards

generic class with primitive data type

// client code

public class Generic {

public static void main(String[] args) {

Room <Integer> myRoom = new Room <Integer>();

...... }

// make a generic class

public class Room <T>

{ .........

.........

}

57
New cards

generic class with object

independent, Object as the type parameter, without relying on limiting yourself to wrapper classes such as Integer, double, character, string

ClassName <Object> obj = new ClassName <> ();

58
New cards

generic advantages

stronger type checks at compile time, elimination of cast, generic algorithms, code reuse

59
New cards

generic programming

allows one piece of data to have multiple data types rather than being dependent on a specific data type

60
New cards

stronger type check at compile time

allows errors to be detected at compile time rather than at runtime, Provide early information on program errors about whether an object is an acceptable type or not,

61
New cards

elimination of cast

no need for a type-casting process for object as required for Java

instead of this: String s = (String) list.get(0);

use this: String s = list.get(0);

62
New cards

generic algorithms

work on different types of objects, can be customized, and are type safe and easier to read

63
New cards

code reuse

can write a method, class, or interface once and use for any type again

64
New cards

array types

static arrays and dynamic arrays

65
New cards

static array

once the number of locations to store in the computer is specified, that number cannot be changed unless the instructions are changed. Compiler determines how memory is allocated at compile time

66
New cards

dynamic array

programmers designated the number of array locations as variable, which means that the memory allocations can be expanded or contracted at runtime

67
New cards

one dimensional array

simplest array structure, consists of one column of memory location, collection of similar data type, fixed size, stores value on basis of index value

68
New cards

two dimensional array

a block of memory locations associated with a single memory variable designated by “row” and “column” numbers, a table which has row and column number, row # is first then column #