Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8660b68
Completed LinkedList, Stack, Queue, Chaining, Linear Probing, Quadrat…
AdityaRao1212 Jan 20, 2023
d835937
Delete Queue$Node.class
AdityaRao1212 Jan 20, 2023
27082f8
Added gitignore file.
AdityaRao1212 Jan 20, 2023
5e47e92
Merge branch 'AdityaRao_Module1' of https://github.com/AdityaRao1212/…
AdityaRao1212 Jan 20, 2023
73fe43c
Delete Queue.class
AdityaRao1212 Jan 20, 2023
c07f0c8
Delete SinglyLinkedList$Node.class
AdityaRao1212 Jan 20, 2023
e82a7a1
Delete SinglyLinkedList.class
AdityaRao1212 Jan 20, 2023
2bfcbb0
Delete Stack$Node.class
AdityaRao1212 Jan 20, 2023
ab02050
Delete Stack.class
AdityaRao1212 Jan 20, 2023
9ee1683
Delete Chaining.class
AdityaRao1212 Jan 20, 2023
99657f1
Delete LinearProbing.class
AdityaRao1212 Jan 20, 2023
9312e78
Delete LinearProbingHashTable.class
AdityaRao1212 Jan 20, 2023
6e3172d
Delete QuadraticProbing.class
AdityaRao1212 Jan 20, 2023
e5d028c
Delete QuadraticProbingHashTable.class
AdityaRao1212 Jan 20, 2023
540d484
Completed Tree, Hashmap, Double Hashing
AdityaRao1212 Jan 20, 2023
8ea5bef
Merge branch 'AdityaRao_Module1' of https://github.com/AdityaRao1212/…
AdityaRao1212 Jan 20, 2023
a027dcf
Updating HashMap Code.
AdityaRao1212 Jan 20, 2023
efa8e86
Added code for graph and Random Probing.
AdityaRao1212 Jan 23, 2023
08a39ad
Removed * from all files and made Hashmap menu-driven.
AdityaRao1212 Jan 30, 2023
a05ecf1
Added peek operation in stack.
AdityaRao1212 Jan 30, 2023
c68bc65
Added Exception Handling for Queue Data Structure.
AdityaRao1212 Jan 30, 2023
89986a9
Added Exception Handling for Stack, Linkedlist Data Structure.
AdityaRao1212 Jan 30, 2023
7ee84f1
Added Exception Handling for Tree Data Structure.
AdityaRao1212 Jan 30, 2023
71b85ed
Added Exception Handling for Hashmap Data Structure.
AdityaRao1212 Jan 30, 2023
2995915
Added Exception Handling, Menu in Chaining Hashing technique.
AdityaRao1212 Jan 30, 2023
f99573c
Added exception handling for Graph Data Structure.
AdityaRao1212 Jan 31, 2023
5f15f9e
Added Exception Handling for LinkedList Data Structure.
AdityaRao1212 Jan 31, 2023
7ff15fa
Added File Structure to the repository.
AdityaRao1212 Jan 31, 2023
4586fc6
Added Output Screenshots for all the data structures.
AdityaRao1212 Feb 1, 2023
79a2ce3
Screenshots update.
AdityaRao1212 Feb 1, 2023
0818bdf
Quadratic Probing Screenshots and code update.
AdityaRao1212 Feb 1, 2023
fb938c6
Updated the code and Screenshots of hashing techniques.
AdityaRao1212 Feb 1, 2023
b082508
Solved writing spec for 5 questions.
AdityaRao1212 Apr 20, 2023
2f9c499
Second Commit.
AdityaRao1212 Apr 21, 2023
8ec3631
Completed 2 questions.
AdityaRao1212 Apr 21, 2023
10df479
Completed 18th question.
AdityaRao1212 Apr 21, 2023
8276a01
Completed question 4.
AdityaRao1212 Apr 21, 2023
3831808
Completed question 32.
AdityaRao1212 Apr 21, 2023
4e43622
Completed question 31.
AdityaRao1212 Apr 21, 2023
3567eb1
Completed question 23.
AdityaRao1212 Apr 21, 2023
49a7106
Completed question 22.
AdityaRao1212 Apr 21, 2023
5c3c414
Completed question 27.
AdityaRao1212 Apr 21, 2023
bf92215
Completed question 24.
AdityaRao1212 Apr 22, 2023
f50f93d
Completed question 5.
AdityaRao1212 Apr 22, 2023
6a02d6d
Completed question 5.
AdityaRao1212 Apr 22, 2023
824a5a0
Completed question 10.
AdityaRao1212 Apr 22, 2023
2cd9ac4
Completed question 25 and 26.
AdityaRao1212 Apr 22, 2023
e48cf5a
Completed question 6,7,14.
AdityaRao1212 Apr 23, 2023
b69f218
Completed question 1.
AdityaRao1212 Apr 23, 2023
2f2b297
Completed question 8, 19, 33.
AdityaRao1212 Apr 23, 2023
05a9941
Completed question 28.
AdityaRao1212 Apr 23, 2023
05b3f41
Removing Module 1.
AdityaRao1212 Apr 24, 2023
d729b95
Delete Module 1 directory
AdityaRao1212 Apr 24, 2023
5829a46
Updating explanations for the Specs.
AdityaRao1212 May 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Module 5/Explanations/Q1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In the corresponding transformation spec:

I concatenated the firstname and the lastname to fullname and also concatenated the address
in one line i.e. flattened the map.
Then multiplied the price and the quantity and converted it io double using the toDouble function
Then used remove operation to remove the unnecessary fields in the map.
The fourth operation is "modify-overwrite-beta" to calculate the total sum of the "total" values.
7 changes: 7 additions & 0 deletions Module 5/Explanations/Q10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In the corresponding transformation spec:

The "name" field is modified using the "split" function to split the value based on the space character (' ').
The "first_name" field is modified using the "firstElement" function to extract the first element from the "name" array.
The "last_name" field is modified using the "lastElement" function to extract the last element from the "name" array.
The second operation is "modify-default-beta" to assign a default value to the "phone_number_count" field.
The third operation is "remove" to remove the "name" field from the JSON structure.
6 changes: 6 additions & 0 deletions Module 5/Explanations/Q11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
In the corresponding transformation spec:

Within "items", the "*" wildcard matches each individual item within the array.
For each item, the "name" field is mapped to the "items[&1].itemName" path.
Similarly, the "value" field is mapped to the "items[&1].itemValue" path.
The "&1" represents the index of the current item being operated on and preserves the order of the items.
8 changes: 8 additions & 0 deletions Module 5/Explanations/Q12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In the corresponding transformation spec:

The nested "address" field is further mapped to separate fields within the "address" object, including "street", "city", "state", and "zip".
The second operation is "modify-overwrite-beta" to modify and overwrite certain fields.
The "name" field is modified using the "concat" function to concatenate the "firstName" and "lastName" fields with a space in between.
Similarly, the "Address" field is also modified.
The third operation is "remove" to remove the "address" field from the JSON structure.
The fourth operation is "shift" to rearrange the transformed data.
8 changes: 8 additions & 0 deletions Module 5/Explanations/Q13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In the corresponding transformation spec:

In the corresponding transformation spec:

For each employee, the "name" field is mapped to "@(1,id).name".
The "@(1,id)" represents the value of the "id" field at the first level and is used as a reference to create a new field at the same level.
The ".name" specifies that the "name" field value should be assigned to the newly created field.
Similarly, the "department" field is mapped to "@(1,id).department" using the same logic.
7 changes: 7 additions & 0 deletions Module 5/Explanations/Q14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In the corresponding transformation spec:

For each phone object, the "type" field is modified using the "concat" function to concatenate the value of the "type" field with the string "Phone". The result is assigned back to the "type" field.
The second operation is "shift" to rearrange the transformed data.
For each phone object, the "number" field is mapped to "[#4].@(1,type)".
The "[#4]" represents the index of the current phone object being operated on, preserving the order of the phone numbers.
The "@(1,type)" retrieves the modified "type" field value from the previous operation and assigns it to the "number" field.
10 changes: 10 additions & 0 deletions Module 5/Explanations/Q16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
In the corresponding transformation spec:

The operation is "shift" with the "spec" section defining transformations on the "employees" field.
The empty string ("") is mapped to "@(1,name).@(1,level)[]".
The "@(1,name)" represents the value of the "name" field at the first level, which is the employee's name.
The "@(1,level)" represents the value of the "level" field at the first level, which is the skill level.
The "[]" notation appends the current skill object to an array under the employee's name and skill level.
The "@(2,name)" is mapped to "@(1,name).@(1,level)[]".
The "@(2,name)" represents the value of the "name" field at the second level, which is the skill name.
This mapping appends the current skill object to the same array as above, under the employee's name and skill level.
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q17.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:

The operation is "modify-overwrite-beta" with the "spec" section defining transformations on the "products" field.
For each product, the "available" field is modified using the "default" function.
The "default(false)" sets the default value of the "available" field to false if it doesn't already exist.
8 changes: 8 additions & 0 deletions Module 5/Explanations/Q18.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In the corresponding transformation spec:

For each employee, the "salary" field is modified using the "divideAndRound" function.

The "divideAndRound(2, @(1,salary), 0.90909091)" divides the value of the "salary" field by 0.90909091 and rounds it to 2 decimal places.
The result is assigned back to the "salary" field.
The second operation is "modify-overwrite-beta". For each employee, the "salary" field is modified using the "toLong" function.
The "toLong" function converts the value of the "salary" field to a long integer
10 changes: 10 additions & 0 deletions Module 5/Explanations/Q19.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
In the corresponding transformation spec:

For each product, there are two modifications:

The "number" field is modified using the "divide" function with arguments 1 and 2. It divides 1 by 2.
The "final" field is modified using the "divide" function. It divides the value of the "price" field by the value of the "number" field in the same product.
The second operation is "shift" with the "spec" section defining transformations on the "products" field.
Within "products", there are two mappings:
"0" matches the product at index 0 in the array.
"*" matches all other products in the array.
3 changes: 3 additions & 0 deletions Module 5/Explanations/Q2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In the corresponding transformation spec:
I used the shift operation to rename the names of key present in the map i.e. capitalize the
first letter of the key.
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q21.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:

The operation is "shift" with the "spec" section defining transformations on the "restaurant" field.
Within "restaurant", there is a nested field "rating" with a subfield "value".
The "value" field under "rating" is mapped to "Restaurant Rating" in the output.
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q22.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:

The operation is "shift" with the "spec" section defining transformations on the input JSON.
The "value" field under "rating" is mapped to "[#4].Restaurant Rating" in the output.
The "[#4]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
7 changes: 7 additions & 0 deletions Module 5/Explanations/Q23.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In the corresponding transformation spec:

The operation is "shift" with the "spec" section defining transformations on the input JSON.
The "value" field under "rating" is mapped to "[#4].Restaurant Rating" in the output.
The "[#4]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
The "value" field under "address" is mapped to "[#4].Restaurant Country" in the output.
Again, the "[#4]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
8 changes: 8 additions & 0 deletions Module 5/Explanations/Q24.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In the corresponding transformation spec:

The "value" field under "rating" is mapped to "[#4].Restaurant Rating" in the output.
The "[#4]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
The same thing is done for "value" field under "address".
The "itemName" field under each item is mapped to "[#4].Dish Name" in the output.
The "itemPrice" field under each item is mapped to "[#4].Dish Price" in the output.
The "[#4]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
8 changes: 8 additions & 0 deletions Module 5/Explanations/Q25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In the corresponding transformation spec:

The "value" field under "rating" is mapped to "[#4].Restaurant Rating" in the output.
The "[#4]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
The same thing is done for "value" field under "address".
The "itemName" field under each item is mapped to "[#4].Dishes[&1].Dish Name" in the output.
The "itemPrice" field under each item is mapped to "[#4].Dishes[&1].Dish Price" in the output.
The "[&1]" notation denotes an array index. It represents the index position in the output array where the value should be placed.
14 changes: 14 additions & 0 deletions Module 5/Explanations/Q26.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
In the corresponding transformation spec:

Within each matched field, there are several transformations:
"returnId" field is mapped to "@(1,Return Id)" in the output.
The "@(1)" notation refers to the first index position in the input array.
"inverse" field is computed using the "divide" function with parameters 1 and the value of "returnQuantity".
"Return Amount" field is computed using the "divide" function with parameters "returnPrice" and "inverse".
"Return Total Amount" field is computed using the "doubleSum" function with parameters "Return Amount" and "returnTax".
The second operation is "remove" with the "spec" section specifying fields to be removed from the input JSON.
The third operation is "shift" with the "spec" section defining transformations on the input JSON.
"returnId" field is mapped to the output field "[&1].Return Id".
"Return Amount" field is mapped to the output field "[&1].Return Amount".
"Return Total Amount" field is mapped to the output field "[&1].Return Total Amount".
The "[&1]" notation refers to the current index position in the output array.
18 changes: 18 additions & 0 deletions Module 5/Explanations/Q27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
In the corresponding transformation spec:

Within each matched field, there are several transformations:
"Return Id" field is mapped to "@(1,returnId)" in the output.
The "@(1)" notation refers to the first index position in the input array.
"returnQuantity" field is computed using the "divide" function with parameters 1 and the value of "returnQuantity".
"Return Amount" field is computed using the "divide" function with parameters "returnPrice" and "returnQuantity".
"Return Total Amount" field is computed using the "doubleSum" function with parameters "Return Amount" and "returnTax".
The second operation is "remove" with the "spec" section specifying fields to be removed from the input JSON.
The third operation is "shift" with the "spec" section defining transformations on the input JSON.
"Return Id" field is mapped to the output field "[#2].&".
"Return Amount" field is mapped to the output field "[#2].&".
"Return Total Amount" field is mapped to the output field "[#2].&".
The "[#2]" notation refers to the current index position in the output array.
"country" field has conditional mappings based on its values:
If the value is "USA", the output field is "[#4].Country" with the value "#United States of America".
If the value is "CA", the output field is "[#4].Country" with the value "#Canada".
If the value is empty (""), the output field is "[#4].Country" with the value "#NA".
4 changes: 4 additions & 0 deletions Module 5/Explanations/Q28.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
In the corresponding transformation spec:
I used shift operation, iterated the map using * and traverse the "returnItemAdjustments" and
iterated the map and replaced amount field by returnTax field.
After that I used Modify-overwrite-beta and applied doubleSum function on returnTax field.
4 changes: 4 additions & 0 deletions Module 5/Explanations/Q29.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
In the corresponding transformation spec:
I used shift opertion traverse inside person map and changed the 'name' and 'age' field with
'person_name' and 'person_age' and then traversed the address map with * wildcard and replaced
the respective fields with person_address_fieldName.
4 changes: 4 additions & 0 deletions Module 5/Explanations/Q3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
In the corresponding transformation spec:
I used the shift operation to change the name of the keys given in the map i.e. capitalize the
first letter of the keys and used the dot (.) operator to change the level of 'city' and 'level'
key.
4 changes: 4 additions & 0 deletions Module 5/Explanations/Q30.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
In the corresponding transformation spec:
I used the shift operation and traversed the person map and renamed the name field and then
traversed the employee map and in that traversed the office map and renamed 'city' field to
'office_city' and 'state' field to 'office_state'.
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q31.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:
I used Modify-overwrite-beta traversed mutipled map and concatenated the values of id and
currency in 'Currencies' field.
After that I used shift operation traversed inside multiple map and changed the name of
'Currencies' field to 'value'.
4 changes: 4 additions & 0 deletions Module 5/Explanations/Q32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
In the corresponding transformation spec:
I used shift operation traversed inside the data map and assigned the field 'value' as
@(1,x).@(1,y) i.e. Create map by the name of value of x (a,b) and Inside that map replace the
value field by the value of y (1,2).
7 changes: 7 additions & 0 deletions Module 5/Explanations/Q33.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In the corresponding transformation spec:
The first operation is "modify-overwrite-beta".It modifies the structure of the "hobbies" array
by adding new fields ("name", "id", "hobby_name", "hobby_level") to each object in the array.
The second operation is "remove". It removes the "id", "name", and "level" fields from each
object in the "hobbies" array.
The third operation is "shift". It restructures the output data to be an array of objects
with each object containing the data for a single hobby
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q34.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:
I used Shift Operation and traversed the hobbies array and replaced
name and level by hobby_1 and level_1 at index 0 and name and level by hobby_2 and
level_2 at index 1.

3 changes: 3 additions & 0 deletions Module 5/Explanations/Q4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In the corresponding transformation spec:
1. I first used the shift operation to capitalize the first letter of the key 'name' and 'age'.
2. After that in the same operation used asterisk(*) to iterate inside the list
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:

I first used Modify-overwrite-beta to concat firstName and lastName into fullName.
I used remove operation to remove the firstname and the lastname from the map.
I used the shift operation to put city and address outside the address map and get the answer.
6 changes: 6 additions & 0 deletions Module 5/Explanations/Q6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
In the corresponding transformation spec:

I used Modify-overwrite-beta to flatten the Address map into string using Concat function.
I used Shift Operation to shift name and address outside the users map
(put Name and Address 2 level up) and make list of hobbies and put it 4 level up
i.e at the same level of name and address using [] and #.
5 changes: 5 additions & 0 deletions Module 5/Explanations/Q7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In the corresponding transformation spec:

Within "students", the "*" wildcard matches each individual student within the array.
The second operation is "shift" to rearrange and map the transformed data to a new structure.
The third operation is "remove" to remove the "email" field from the JSON structure.
9 changes: 9 additions & 0 deletions Module 5/Explanations/Q8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
In the corresponding transformation spec:

For each specific name, there are further mappings:
For "John Doe":
"@(2,name)" represents the name property at the second level and is mapped to
"employees[&3].name".
"#1000" represents a specific value and is mapped to "employees[&3].bonus", likewise for other.
The second operation is "modify-overwrite-beta" to modify and overwrite the "bonus" field as an
integer.
3 changes: 3 additions & 0 deletions Module 5/Explanations/Q9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In the corresponding transformation spec:

In this simply using remove operation and removing the state field will yield the desired result.
Loading