[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-670912-105":59,"doc-detail-670912-en":130,"doc-similar-670912":160},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","cos-226-algorithms-and-data-structures-midterm-fall-2011","COS 226 Algorithms and Data Structures - Midterm - Fall 2011","","Midterm exam for COS 226 Algorithms and Data Structures (Fall 2011), consisting of nine questions totaling 60 points. The exam is closed book with an allowed one-page cheatsheet and prohibits calculators or other electronic devices. Students must answer questions and show work in the provided spaces, complete and sign an Honor Code pledge, and include required identification details such as name, Princeton NetID, and precept number. The problems cover union-find behavior, algorithm running-time estimation with tilde notation, linked-list memory modeling, sorting/shuffling algorithm matching, and binary heap representations and operations.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":20,"@type":76,"position":81},"https://docshare.wps.com/document/exam/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/cos-226-algorithms-and-data-structures-midterm-fall-2011/670912/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/cos-226-algorithms-and-data-structures-midterm-fall-2011/670912.png","ImageObject",300,407,{"name":92,"@type":93},"Cart","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-12-02","2026-11-01",true,{"@type":102,"interactionType":103,"userInteractionCount":81},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What rules apply to this COS 226 midterm regarding materials and devices?","Question",{"text":112,"@type":113},"The exam is closed book. A one-page cheatsheet is allowed, but calculators or other electronic devices are not permitted.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What must be completed before turning in the exam?",{"text":117,"@type":113},"Students must write and sign the Honor Code pledge, provide their name and Princeton NetID, circle the precept number, and write answers with work shown in the provided spaces.",{"name":119,"@type":110,"acceptedAnswer":120},"Which topics are covered in the midterm questions?",{"text":121,"@type":113},"The exam covers weighted quick union feasibility, algorithm running-time estimation using tilde notation, linked-list memory and operation growth, sorting/shuffling algorithm identification from intermediate states, and binary heap array representation and insert/delete-max operations.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},670912,1793572678,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":19,"category_name":20,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":81,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":39,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":129,"read_time":46,"preview_page_count":19,"preview_urls":143},18829141979164,"https://eur-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","COS 226 Algorithms and Data Structures Fall 2011  \nMidterm  \nThis test has 9 questions worth a total of 60 points. You have 80 minutes. The exam is closed book, except that you are allowed to use a one page cheatsheet. No calculators or other electronic devices are permitted. Give your answers and show your work in the space provided. Write out and sign the Honor Code pledge before turning in the test.  \n\\I pledge my honor that I have not violated the Honor Code during this examination. \"  \n\n| Problem | Score |\n| --- | --- |\n| 0 |  |\n| 1 |  |\n| 2 |  |\n| 3 |  |\n| 4 |  |\n| Sub 1 |  |\n\n\n| Total |  |\n| --- | --- |\n\n\n| Problem | Score |\n| --- | --- |\n| 5 |  |\n| 6 |  |\n| 7 |  |\n| 8 |  |\n|  |  |\n| Sub 2 |  |\n\nName:  \nLogin ID: Precept:  \nP01  \nP01A  \nP02  \nP02A  \nP03  \nP03A  \n11  \n11  \n12:30  \n12:30  \n1:30  \n1:30  \nMaia Ginsburg Aman Dhesi Sasha Koruga Joey Dodds Maia Ginsburg Joey Dodds  \n2 PRINCETON UNIVERSITY  \n0. Miscellaneous. (1 point)  \nIn the space provided on the front of the exam, write your name and Princeton NetID; circle your precept number; and write and sign the honor code.  \n1. Union 􀀌nd. (6 points)  \nCircle the letters corresponding to arrays that cannot possibly occur during the execution of weighted quick union.  \ni: 0  \n1  \n2 3 4 5 6 7 8 9  \nA . a[i]: 1 2 3 0 1 1 1 4 4 5  \nB . a[i]: 9 0 0 0 0 0 9 9 9 9  \nC . a[i]: 1 2 3 4 5 6 7 8 9 9  \nD . a[i]: 0 0 0 0 0 1 1 1 6 2  \nE . a[i]: 0 0 0 0 0 1 1 1 6 8  \nF . a[i]: 0 0 0 1 1 3 3 7 7 7  \n2. Analysis of algorithms. (6 points)  \nSuppose that you collect the following timing data for a program as a function of the input size N.  \nN  \ntime  \n125  \n1,000 8,000 64,000  \n512,000  \n0.03 sec  \n1.00 sec  \n32.00 sec  \n1,024.00 sec 32,768.00 sec  \nEstimate the running time of the program (in seconds) as a function of N and use tilde notation to simplify your answer.  \nHint: recall that logba = lg a= lg b:  \nCOS 226 MIDTERM, FALL 2011 3  \n3. Data structures. (9 points)  \nSuppose that the Java library java.util.LinkedList is implemented using a doubly-linked list, maintaining a reference to the 􀀌rst and last node in the list, along with its size.  \npublic class LinkedList\u003CItem> {  \nprivate Node first; // the first node in the linked list  \nprivate Node last; // the last node in the linked list  \nprivate int N; // number of items in the linked list  \nprivate class Node {  \nprivate Item item; // the item  \nprivate Node next, prev; // the next and previous nodes  \n}  \n...  \n}  \n(a) Using the 64-bit memory cost model from the textbook, how much memory (in bytes) does a Node object use and how much does a LinkedList object use to store N items? Do not include the memory for the items themselves but do include the memory for the references to them.  \n􀀏 Memory of a Node:  \n􀀏 Memory of a LinkedList with N items:  \n(b) What is the order of growth of the worst-case running time of each of operation below? Write down the best answer in the space provided, using one of the following possibilities.  \n1 log N pN  N N log N N 2  \n\n| addFirst(item) | prepend the item to the beginning of the list |  |\n| --- | --- | --- |\n| get(i) | return the item at position i in the list |  |\n| set(i, item) | replace position i in the list with the item |  |\n| removeLast() | delete and return the item at the end of the list |  |\n| contains(item) | is the item in the list? |  |\n\n4 PRINCETON UNIVERSITY  \n4. 8 sorting and shu􀀏ing algorithms. (8 points)  \nThe column on the left is the original input of strings to be sorted or shu􀀏ed; the column on the right are the string in sorted order; the other columns are the contents at some intermediate step during one of the 8 algorithms listed below. Match up each algorithm by writing its number under the corresponding column. Use each number exactly once.  \nnavy coal corn blue blue blue wine bark mist bark plum jade mist gray coal coal teal blue coal blue coal navy coal rose gray corn silk cafe jade cafe jade plum jade mint jade gray plum coal blue coal blue blue blue lime lime","cbCaif00DEuhsFeO","https://ap.wps.com/l/cbCaif00DEuhsFeO","pdf",290162,"English","# Exam Instructions\n## Honor Code and Submission Requirements\n## Questions by Topic\n# Union-Find Arrays\n## Weighted Quick Union Constraint Identification\n# Analysis of Algorithms\n## Running Time Estimation with Tilde Notation\n# Data Structures\n## LinkedList Memory Cost Model\n## LinkedList Operation Growth Bounds\n# Sorting and Shuffling Algorithms\n## Matching Algorithms to Intermediate States\n# Binary Heaps\n## Array Representation and Insert/Delete Operations","[{\"question\":\"What rules apply to this COS 226 midterm regarding materials and devices?\",\"answer\":\"The exam is closed book. A one-page cheatsheet is allowed, but calculators or other electronic devices are not permitted.\"},{\"question\":\"What must be completed before turning in the exam?\",\"answer\":\"Students must write and sign the Honor Code pledge, provide their name and Princeton NetID, circle the precept number, and write answers with work shown in the provided spaces.\"},{\"question\":\"Which topics are covered in the midterm questions?\",\"answer\":\"The exam covers weighted quick union feasibility, algorithm running-time estimation using tilde notation, linked-list memory and operation growth, sorting/shuffling algorithm identification from intermediate states, and binary heap array representation and insert/delete-max operations.\"}]","COS 226 Algorithms and Data Structures - Midterm - Fall 2011 | PDF",[144,148,152,156],{"page_no":8,"url":145,"width":146,"height":147},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/57c39d337d6206589ed4eaa1c332e483.webp",983,1272,{"page_no":14,"url":149,"width":150,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/248a10786458bec07cf90f3f689c62b2.webp",982,1270,{"page_no":81,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/646c8373ddd7f45383e146d672635cda.webp",981,1269,{"page_no":19,"url":157,"width":158,"height":159},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/e4b3b01c5c48f42b311a6744d6a0df70.webp",980,1268,{"list":161,"token":66},[162,169,175,181,188,195,201,208,215,222],{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":167,"category_name":20,"create_tm":168},289704,"Stat 2000 International - Sample Midterm 2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229903431088/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=cJYs8oOQYZZQ8pvwBtzTxfX5Mj0%3D","stat-2000-international-sample-midterm-2",11,1789636548,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":167,"category_name":20,"create_tm":174},395059,"COS 433: Cryptography - Princeton University - Final Exam","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229918602409/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=yVPT0AlhBPlLt7aRKasmLH7HasM%3D","cos-433-cryptography-princeton-university-final-exam",1790415673,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":52,"category_name":20,"create_tm":180},322275,"EECS 485 Midterm Exam Fall 2016 - Solution","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229908763218/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=SIH6nlz5Bdu8dAA0FR81gZOvJSw%3D","eecs-485-midterm-exam-fall-2016-solution",1789962294,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":186,"category_name":20,"create_tm":187},390347,"CS165 - Practice Final Exam Questions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917226541/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=5AW5b5NrHQas8YjlIdWNR12oinQ%3D","cs165-practice-final-exam-questions",14,1790333069,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":193,"category_name":20,"create_tm":194},454331,"[NEW-2026] CCAR-F PDF Dumps(1-90)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229925034188/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=GqFfPS1musW2AxKKF5ILOTI%2Fh3E%3D","new-2026-ccar-f-pdf-dumps1-90",29,1790740518,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":186,"category_name":20,"create_tm":200},179789,"ACCT350Syllabus F23 - Grading, Exam Policies, Canvas and Tableau","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229876630989/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=1lYXEAspx0BWIJwZwW7jjphqJc4%3D","acct350syllabus-f23-grading-exam-policies-canvas-and-tableau",1788338257,{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":206,"category_name":20,"create_tm":207},315027,"What exam scores can and cannot prove about unauthorized AI assistance: Evidence from a highly public classroom episode","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229907378489/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=WoEYVN7VTLYBY%2BnclTKvzVtRr28%3D","what-exam-scores-can-and-cannot-prove-about-unauthorized-ai-assistance-evidence-from-a-highly-public-classroom-episode",15,1789902654,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":213,"category_name":20,"create_tm":214},397461,"ALEKS PPL Assessment Enrollment & Scheduling Tutorial - Step 1 Payment - Step 2 Exam Scheduling","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229919119208/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=azTblvQcvaLOpYAZqx%2BjjakYoi0%3D","aleks-ppl-assessment-enrollment-scheduling-tutorial-step-1-payment-step-2-exam-scheduling",18,1790462016,{"doc_id":216,"doc_title":217,"file_type":137,"home_preview_img_url":218,"slug":219,"view_count":220,"category_name":20,"create_tm":221},13897,"Company Board LGS Confusing Facts Pradeep Mukhathala","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229698990384/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=U7cIr6XD3lNscH%2BI0UkmZfwc754%3D","company-board-lgs-confusing-facts-pradeep-mukhathala",79,1776557116,{"doc_id":223,"doc_title":224,"file_type":137,"home_preview_img_url":225,"slug":226,"view_count":227,"category_name":20,"create_tm":228},400315,"Physics Junior Laboratories Experiment Schedule - Fall 2013 - Schedule","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229919685760/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796575379&Signature=ZsKexF64MnfqktTeeBoc99ZB2mk%3D","physics-junior-laboratories-experiment-schedule-fall-2013-schedule",12,1790510544]