100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

C949 Data Structures And Algorithms Questions and Answers(A+ Solution guide)

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
08-11-2023
Written in
2023/2024

Record - Data structure that stores subitems, w/ names associated w/ each subitem Array - Data structure that stores an ordered list of items, w/ each item directly accessible by a positional index. Linked List - Data structure that stores an ordered list as nodes, each node stores data and has a pointer to the next node. Binary Tree - Data structure where each node stores data and has up to two children, left child and right child. Hash Table - Data structure that stores unordered items by mapping each item to a location in an array. Max Heap - Tree that maintains the simple property that a node's key is greater than or equal to a node's children key. Min Heap - A tree that maintains simple property that node's key is less than or equal to the node's children key. Graph - Represents connections among items. Consists of vertices and edges. Vertex represents an item on a graph. Edges represent a connection between two vertices. ADT (Abstract Data Type) -Data type described by predefined user operations. Does not say anything about the implementation. List - Common ADT for holding ordered data.Like an array. Can store ints, strings. Ex. nums = [5, 25, 30]Queue - ADT where items are inserted at the end and removed at the front. First in first out ADT. push - inserts items at the end pop - removes and returns the item at the front Dictionary - Maps keys to values. Uses {}. The value can be number,string, or tuple. Can be any type. ex. players = { 'Lionel Messi': 10, 'Christiano Ronaldo': 7 } If else statement - Branching directs programs to execute either one group of statements or another. ex. if expression: # Statements to execute when expression is true else: # Statements to execute when expression is false # Statements here execute after the if-else. Boolean Operators - Has 3 operators: and / or / not In Python, True/False are case sensitive Membership Operators - not , in Cannot check for values but can check for keys. ex. my_dict = {'A': 1, 'B': 2, 'C': 3}if 'B' in my_dict: print("Found 'B'") else: print("'B' not found") # operator does not check values if 3 in my_dict: print('Found 3') else: print('3 not found') reversed() - Iterates over a for loop backwards. ex. print('nPrinting in reverse:') for name in reversed(names): print(name, '|', end=' ') Function (invoking a function is called a function call, which causes a function to execute. ) - Named series of statements. e.g.: def compute_square(num_square): return num_square * num_square Polymorphism - Behavior of function depends on argument type. ex. 'x' * 5 = 'xxxxx' Global - Used to change value of a global variable inside of a . employee_name = 'N/A' def get_name(): global employee_name name = input('Enter employee name:') employee_name = name get_name() print('Employee name:', employee_name) instantiation - is performed by "calling" the class, using parentheses like a function call as in my_time = Time(). - creates an instance, which is an individual object of the given class. automatically calls the __init__ method defined in the class definition. - A method is a function defined within a class. T - __init__ method, commonly known as a constructor, is responsible for setting up the initial state of the new instance with attributes ex. class Time(object): def __init__(self): = 0 es = 0 time1 = Time() = 7 es = 15Recursive Function - A function can call itself or other functions. Ex. def count_down(count): if count == 0: print('Go!') else: print(count) count_down(count-1) count_down(2)

Show more Read less
Institution
C949 Data Structures And Algorithms
Course
C949 Data Structures And Algorithms









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
C949 Data Structures And Algorithms
Course
C949 Data Structures And Algorithms

Document information

Uploaded on
November 8, 2023
Number of pages
9
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
PatrickKaylian Delaware State University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1823
Member since
2 year
Number of followers
1044
Documents
22140
Last sold
23 hours ago

3.8

317 reviews

5
147
4
60
3
54
2
16
1
40

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions